Fix frame dumping for linux.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7134 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
16c4ffd89b
commit
6cbaa360a1
|
@ -34,11 +34,11 @@ public:
|
||||||
, m_bits(16)
|
, m_bits(16)
|
||||||
, m_channels(2)
|
, m_channels(2)
|
||||||
, m_HLEready(false)
|
, m_HLEready(false)
|
||||||
|
, m_logAudio(0)
|
||||||
, m_numSamples(0)
|
, m_numSamples(0)
|
||||||
, m_indexW(0)
|
, m_indexW(0)
|
||||||
, m_indexR(0)
|
, m_indexR(0)
|
||||||
, m_AIplaying(true)
|
, m_AIplaying(true)
|
||||||
, m_logAudio(0)
|
|
||||||
{
|
{
|
||||||
// AyuanX: The internal (Core & DSP) sample rate is fixed at 32KHz
|
// AyuanX: The internal (Core & DSP) sample rate is fixed at 32KHz
|
||||||
// So when AI/DAC sample rate differs than 32KHz, we have to do re-sampling
|
// So when AI/DAC sample rate differs than 32KHz, we have to do re-sampling
|
||||||
|
|
|
@ -256,14 +256,14 @@ bool AVIDump::CreateFile()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_Stream->codec->codec_id = CODEC_ID_FFV1; //s_FormatContext->oformat->video_codec;
|
s_Stream->codec->codec_id = s_FormatContext->oformat->video_codec;
|
||||||
s_Stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
s_Stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
s_Stream->codec->bit_rate = 400000;
|
s_Stream->codec->bit_rate = 400000;
|
||||||
s_Stream->codec->width = s_width;
|
s_Stream->codec->width = s_width;
|
||||||
s_Stream->codec->height = s_height;
|
s_Stream->codec->height = s_height;
|
||||||
s_Stream->codec->time_base = (AVRational){1, VideoInterface::TargetRefreshRate};
|
s_Stream->codec->time_base = (AVRational){1, VideoInterface::TargetRefreshRate};
|
||||||
s_Stream->codec->gop_size = 12;
|
s_Stream->codec->gop_size = 12;
|
||||||
s_Stream->codec->pix_fmt = PIX_FMT_BGRA;
|
s_Stream->codec->pix_fmt = PIX_FMT_YUV420P;
|
||||||
|
|
||||||
av_set_parameters(s_FormatContext, NULL);
|
av_set_parameters(s_FormatContext, NULL);
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ bool AVIDump::CreateFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(s_SwsContext = sws_getContext(s_width, s_height, PIX_FMT_BGR24, s_width, s_height,
|
if(!(s_SwsContext = sws_getContext(s_width, s_height, PIX_FMT_BGR24, s_width, s_height,
|
||||||
PIX_FMT_BGRA, SWS_BICUBIC, NULL, NULL, NULL)))
|
PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL)))
|
||||||
{
|
{
|
||||||
CloseFile();
|
CloseFile();
|
||||||
return false;
|
return false;
|
||||||
|
@ -284,10 +284,10 @@ bool AVIDump::CreateFile()
|
||||||
s_BGRFrame = avcodec_alloc_frame();
|
s_BGRFrame = avcodec_alloc_frame();
|
||||||
s_YUVFrame = avcodec_alloc_frame();
|
s_YUVFrame = avcodec_alloc_frame();
|
||||||
|
|
||||||
s_size = avpicture_get_size(PIX_FMT_BGRA, s_width, s_height);
|
s_size = avpicture_get_size(PIX_FMT_YUV420P, s_width, s_height);
|
||||||
|
|
||||||
s_YUVBuffer = new uint8_t[s_size];
|
s_YUVBuffer = new uint8_t[s_size];
|
||||||
avpicture_fill((AVPicture *)s_YUVFrame, s_YUVBuffer, PIX_FMT_BGRA, s_width, s_height);
|
avpicture_fill((AVPicture *)s_YUVFrame, s_YUVBuffer, PIX_FMT_YUV420P, s_width, s_height);
|
||||||
|
|
||||||
s_OutBuffer = new uint8_t[s_size];
|
s_OutBuffer = new uint8_t[s_size];
|
||||||
|
|
||||||
|
|
|
@ -959,7 +959,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
|
||||||
// This function has the final picture. We adjust the aspect ratio here.
|
// This function has the final picture. We adjust the aspect ratio here.
|
||||||
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,const EFBRectangle& rc,float Gamma)
|
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,const EFBRectangle& rc,float Gamma)
|
||||||
{
|
{
|
||||||
static u8 *data = 0;
|
static u8 *data = NULL;
|
||||||
static int w = 0, h = 0;
|
static int w = 0, h = 0;
|
||||||
if (g_bSkipCurrentFrame || (!XFBWrited && (!g_ActiveConfig.bUseXFB || !g_ActiveConfig.bUseRealXFB)) || !fbWidth || !fbHeight)
|
if (g_bSkipCurrentFrame || (!XFBWrited && (!g_ActiveConfig.bUseXFB || !g_ActiveConfig.bUseRealXFB)) || !fbWidth || !fbHeight)
|
||||||
{
|
{
|
||||||
|
@ -1198,7 +1198,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
delete[] data;
|
delete[] data;
|
||||||
data = 0;
|
data = NULL;
|
||||||
w = h = 0;
|
w = h = 0;
|
||||||
}
|
}
|
||||||
AVIDump::Stop();
|
AVIDump::Stop();
|
||||||
|
|
Loading…
Reference in New Issue