mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-28 07:16:37 +02:00
Merge pull request #5486 from raven02/patch-25
Use GE_CMODE instead of TPSM_PIXEL_STORAGE_MODE
This commit is contained in:
@@ -51,6 +51,12 @@ static const int MPEG_VERSION_0013 = 1;
|
||||
static const int MPEG_VERSION_0014 = 2;
|
||||
static const int MPEG_VERSION_0015 = 3;
|
||||
|
||||
// PSMF analysis results.
|
||||
static const int PSMF_VERSION_0012 = 0x32313030;
|
||||
static const int PSMF_VERSION_0013 = 0x33313030;
|
||||
static const int PSMF_VERSION_0014 = 0x34313030;
|
||||
static const int PSMF_VERSION_0015 = 0x35313030;
|
||||
|
||||
// MPEG streams.
|
||||
static const int MPEG_AVC_STREAM = 0;
|
||||
static const int MPEG_ATRAC_STREAM = 1;
|
||||
|
||||
@@ -27,34 +27,16 @@ enum {
|
||||
ERROR_MPEG_NO_MEMORY = 0x80610022,
|
||||
ERROR_MPEG_INVALID_ADDR = 0x80610103,
|
||||
ERROR_MPEG_INVALID_VALUE = 0x806101fe,
|
||||
|
||||
ERROR_PSMF_NOT_INITIALIZED = 0x80615001,
|
||||
ERROR_PSMF_BAD_VERSION = 0x80615002,
|
||||
ERROR_PSMF_NOT_FOUND = 0x80615025,
|
||||
ERROR_PSMF_INVALID_ID = 0x80615100,
|
||||
ERROR_PSMF_INVALID_VALUE = 0x806151fe,
|
||||
ERROR_PSMF_INVALID_TIMESTAMP = 0x80615500,
|
||||
ERROR_PSMF_INVALID_PSMF = 0x80615501,
|
||||
|
||||
ERROR_PSMFPLAYER_NOT_INITIALIZED = 0x80616001,
|
||||
ERROR_PSMFPLAYER_NO_MORE_DATA = 0x8061600c,
|
||||
|
||||
ERROR_MPEG_NO_DATA = 0x80618001,
|
||||
ERROR_MPEG_ALREADY_INIT = 0x80618005,
|
||||
ERROR_MPEG_NOT_YET_INIT = 0x80618009,
|
||||
|
||||
ERROR_MPEG_AVC_INVALID_VALUE = 0x806201fe,
|
||||
ERROR_MPEG_AVC_DECODE_FATAL = 0x80628002,
|
||||
|
||||
ERROR_JPEG_INVALID_VALUE = 0x80650051,
|
||||
};
|
||||
|
||||
// MPEG statics.
|
||||
static const u32 PSMF_MAGIC = 0x464D5350;
|
||||
static const int PSMF_VERSION_0012 = 0x32313030;
|
||||
static const int PSMF_VERSION_0013 = 0x33313030;
|
||||
static const int PSMF_VERSION_0014 = 0x34313030;
|
||||
static const int PSMF_VERSION_0015 = 0x35313030;
|
||||
static const int PSMF_STREAM_VERSION_OFFSET = 0x4;
|
||||
static const int PSMF_STREAM_OFFSET_OFFSET = 0x8;
|
||||
static const int PSMF_STREAM_SIZE_OFFSET = 0xC;
|
||||
|
||||
+15
-3
@@ -57,6 +57,18 @@ int audioSamplesBytes = audioSamples * 4;
|
||||
int videoPixelMode = GE_CMODE_32BIT_ABGR8888;
|
||||
int videoLoopStatus = PSMF_PLAYER_CONFIG_NO_LOOP;
|
||||
|
||||
enum PsmfPlayerError {
|
||||
ERROR_PSMF_NOT_INITIALIZED = 0x80615001,
|
||||
ERROR_PSMF_BAD_VERSION = 0x80615002,
|
||||
ERROR_PSMF_NOT_FOUND = 0x80615025,
|
||||
ERROR_PSMF_INVALID_ID = 0x80615100,
|
||||
ERROR_PSMF_INVALID_VALUE = 0x806151fe,
|
||||
ERROR_PSMF_INVALID_TIMESTAMP = 0x80615500,
|
||||
ERROR_PSMF_INVALID_PSMF = 0x80615501,
|
||||
ERROR_PSMFPLAYER_NOT_INITIALIZED = 0x80616001,
|
||||
ERROR_PSMFPLAYER_NO_MORE_DATA = 0x8061600c,
|
||||
};
|
||||
|
||||
enum PsmfPlayerStatus {
|
||||
PSMF_PLAYER_STATUS_NONE = 0x0,
|
||||
PSMF_PLAYER_STATUS_INIT = 0x1,
|
||||
@@ -898,7 +910,7 @@ int scePsmfPlayerStop(u32 psmfPlayer)
|
||||
|
||||
int scePsmfPlayerBreak(u32 psmfPlayer)
|
||||
{
|
||||
ERROR_LOG(ME, "UNIMPL scePsmfPlayerBreak(%08x)", psmfPlayer);
|
||||
WARN_LOG(ME, "scePsmfPlayerBreak(%08x)", psmfPlayer);
|
||||
PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
|
||||
if (!psmfplayer) {
|
||||
ERROR_LOG(ME, "scePsmfPlayerBreak(%08x): invalid psmf player", psmfPlayer);
|
||||
@@ -1058,7 +1070,7 @@ int scePsmfPlayerGetAudioOutSize(u32 psmfPlayer)
|
||||
|
||||
int scePsmfPlayerStart(u32 psmfPlayer, u32 psmfPlayerData, int initPts)
|
||||
{
|
||||
WARN_LOG(ME, "UNIMPL scePsmfPlayerStart(%08x, %08x, %08x)", psmfPlayer, psmfPlayerData, initPts);
|
||||
WARN_LOG(ME, "scePsmfPlayerStart(%08x, %08x, %08x)", psmfPlayer, psmfPlayerData, initPts);
|
||||
|
||||
PsmfPlayer *psmfplayer = getPsmfPlayer(psmfPlayer);
|
||||
|
||||
@@ -1169,7 +1181,7 @@ int scePsmfPlayerReleasePsmf(u32 psmfPlayer)
|
||||
return ERROR_PSMFPLAYER_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
ERROR_LOG(ME, "UNIMPL scePsmfPlayerReleasePsmf(%08x)", psmfPlayer);
|
||||
WARN_LOG(ME, "scePsmfPlayerReleasePsmf(%08x)", psmfPlayer);
|
||||
psmfplayer->status = PSMF_PLAYER_STATUS_INIT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+17
-22
@@ -35,11 +35,6 @@ extern "C" {
|
||||
}
|
||||
#endif // USE_FFMPEG
|
||||
|
||||
static const int TPSM_PIXEL_STORAGE_MODE_16BIT_BGR5650 = 0x00;
|
||||
static const int TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR5551 = 0x01;
|
||||
static const int TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR4444 = 0x02;
|
||||
static const int TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888 = 0x03;
|
||||
|
||||
int g_iNumVideos = 0;
|
||||
|
||||
#ifdef USE_FFMPEG
|
||||
@@ -47,13 +42,13 @@ static AVPixelFormat getSwsFormat(int pspFormat)
|
||||
{
|
||||
switch (pspFormat)
|
||||
{
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_BGR5650:
|
||||
case GE_CMODE_16BIT_BGR5650:
|
||||
return AV_PIX_FMT_BGR565LE;
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR5551:
|
||||
case GE_CMODE_16BIT_ABGR5551:
|
||||
return AV_PIX_FMT_BGR555LE;
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR4444:
|
||||
case GE_CMODE_16BIT_ABGR4444:
|
||||
return AV_PIX_FMT_BGR444LE;
|
||||
case TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888:
|
||||
case GE_CMODE_32BIT_ABGR8888:
|
||||
return AV_PIX_FMT_RGBA;
|
||||
default:
|
||||
ERROR_LOG(ME, "Unknown pixel format");
|
||||
@@ -101,11 +96,11 @@ static int getPixelFormatBytes(int pspFormat)
|
||||
{
|
||||
switch (pspFormat)
|
||||
{
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_BGR5650:
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR5551:
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR4444:
|
||||
case GE_CMODE_16BIT_BGR5650:
|
||||
case GE_CMODE_16BIT_ABGR5551:
|
||||
case GE_CMODE_16BIT_ABGR4444:
|
||||
return 2;
|
||||
case TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888:
|
||||
case GE_CMODE_32BIT_ABGR8888:
|
||||
return 4;
|
||||
|
||||
default:
|
||||
@@ -415,7 +410,7 @@ bool MediaEngine::setVideoDim(int width, int height)
|
||||
|
||||
m_sws_ctx = NULL;
|
||||
m_sws_fmt = -1;
|
||||
updateSwsFormat(TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888);
|
||||
updateSwsFormat(GE_CMODE_32BIT_ABGR8888);
|
||||
|
||||
// Allocate video frame for RGB24
|
||||
m_pFrameRGB = av_frame_alloc();
|
||||
@@ -572,7 +567,7 @@ int MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMo
|
||||
const u8 *data = m_pFrameRGB->data[0];
|
||||
|
||||
switch (videoPixelMode) {
|
||||
case TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888:
|
||||
case GE_CMODE_32BIT_ABGR8888:
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineRGBA(imgbuf, data, width);
|
||||
data += width * sizeof(u32);
|
||||
@@ -581,7 +576,7 @@ int MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMo
|
||||
videoImageSize = frameWidth * sizeof(u32) * height;
|
||||
break;
|
||||
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_BGR5650:
|
||||
case GE_CMODE_16BIT_BGR5650:
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineABGR5650(imgbuf, data, width);
|
||||
data += width * sizeof(u16);
|
||||
@@ -590,7 +585,7 @@ int MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMo
|
||||
videoImageSize = frameWidth * sizeof(u16) * height;
|
||||
break;
|
||||
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR5551:
|
||||
case GE_CMODE_16BIT_ABGR5551:
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineABGR5551(imgbuf, data, width);
|
||||
data += width * sizeof(u16);
|
||||
@@ -599,7 +594,7 @@ int MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMo
|
||||
videoImageSize = frameWidth * sizeof(u16) * height;
|
||||
break;
|
||||
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR4444:
|
||||
case GE_CMODE_16BIT_ABGR4444:
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineABGR4444(imgbuf, data, width);
|
||||
data += width * sizeof(u16);
|
||||
@@ -641,7 +636,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid
|
||||
height = m_desHeight - ypos;
|
||||
|
||||
switch (videoPixelMode) {
|
||||
case TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888:
|
||||
case GE_CMODE_32BIT_ABGR8888:
|
||||
data += (ypos * m_desWidth + xpos) * sizeof(u32);
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineRGBA(imgbuf, data, width);
|
||||
@@ -651,7 +646,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid
|
||||
videoImageSize = frameWidth * sizeof(u32) * m_desHeight;
|
||||
break;
|
||||
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_BGR5650:
|
||||
case GE_CMODE_16BIT_BGR5650:
|
||||
data += (ypos * m_desWidth + xpos) * sizeof(u16);
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineABGR5650(imgbuf, data, width);
|
||||
@@ -661,7 +656,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid
|
||||
videoImageSize = frameWidth * sizeof(u16) * m_desHeight;
|
||||
break;
|
||||
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR5551:
|
||||
case GE_CMODE_16BIT_ABGR5551:
|
||||
data += (ypos * m_desWidth + xpos) * sizeof(u16);
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineABGR5551(imgbuf, data, width);
|
||||
@@ -671,7 +666,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid
|
||||
videoImageSize = frameWidth * sizeof(u16) * m_desHeight;
|
||||
break;
|
||||
|
||||
case TPSM_PIXEL_STORAGE_MODE_16BIT_ABGR4444:
|
||||
case GE_CMODE_16BIT_ABGR4444:
|
||||
data += (ypos * m_desWidth + xpos) * sizeof(u16);
|
||||
for (int y = 0; y < height; y++) {
|
||||
writeVideoLineABGR4444(imgbuf, data, width);
|
||||
|
||||
Reference in New Issue
Block a user