Guest User

Untitled

a guest
May 3rd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.41 KB | None | 0 0
  1. diff --git a/mythtv/external/FFmpeg/libavcodec/mpeg12.c b/mythtv/external/FFmpeg/libavcodec/mpeg12.c
  2. index 805890d..4d8a5e7 100644
  3. --- a/mythtv/external/FFmpeg/libavcodec/mpeg12.c
  4. +++ b/mythtv/external/FFmpeg/libavcodec/mpeg12.c
  5. @@ -1202,6 +1202,7 @@ static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = {
  6. #endif
  7. #if CONFIG_MPEG1_VDPAU_HWACCEL
  8. AV_PIX_FMT_VDPAU_MPEG1,
  9. + AV_PIX_FMT_VDPAU,
  10. #endif
  11. AV_PIX_FMT_YUV420P,
  12. AV_PIX_FMT_NONE
  13. @@ -1214,6 +1215,7 @@ static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
  14. #endif
  15. #if CONFIG_MPEG2_VDPAU_HWACCEL
  16. AV_PIX_FMT_VDPAU_MPEG2,
  17. + AV_PIX_FMT_VDPAU,
  18. #endif
  19. #if CONFIG_MPEG2_DXVA2_HWACCEL
  20. AV_PIX_FMT_DXVA2_VLD,
  21. diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
  22. index 8f3fc70..37c7e49 100644
  23. --- a/mythtv/libs/libmythtv/avformatdecoder.cpp
  24. +++ b/mythtv/libs/libmythtv/avformatdecoder.cpp
  25. @@ -46,6 +46,7 @@ using namespace std;
  26. #include "videoout_vdpau.h"
  27. extern "C" {
  28. #include "libavcodec/vdpau.h"
  29. +#include "libavutil/pixdesc.h"
  30. }
  31. #endif // USING_VDPAU
  32.  
  33. @@ -222,19 +223,19 @@ static int has_codec_parameters(AVStream *st)
  34. return 1;
  35. }
  36.  
  37. -static AVCodec *find_vdpau_decoder(AVCodec *c, enum CodecID id)
  38. -{
  39. - AVCodec *codec = c;
  40. - while (codec)
  41. - {
  42. - if (codec->id == id && CODEC_IS_VDPAU(codec))
  43. - return codec;
  44. -
  45. - codec = codec->next;
  46. - }
  47. -
  48. - return c;
  49. -}
  50. +//static AVCodec *find_vdpau_decoder(AVCodec *c, enum CodecID id)
  51. +//{
  52. +// AVCodec *codec = c;
  53. +// while (codec)
  54. +// {
  55. +// if (codec->id == id && CODEC_IS_VDPAU(codec))
  56. +// return codec;
  57. +//
  58. +// codec = codec->next;
  59. +// }
  60. +//
  61. +// return c;
  62. +//}
  63.  
  64. static bool force_sw_decode(AVCodecContext *avctx)
  65. {
  66. @@ -1430,13 +1431,23 @@ static bool IS_VDPAU_PIX_FMT(enum PixelFormat fmt)
  67. static enum PixelFormat get_format_vdpau(struct AVCodecContext *avctx,
  68. const enum PixelFormat *fmt)
  69. {
  70. - int i = 0;
  71. + LOG(VB_PLAYBACK, LOG_DEBUG, LOC + QString("Format = %1 (%2)")
  72. + .arg((int)*fmt).arg(av_get_pix_fmt_name(*fmt)));
  73. +
  74. + return AV_PIX_FMT_VDPAU;
  75. +
  76. + const PixelFormat * cur = fmt;
  77.  
  78. - for(i=0; fmt[i]!=PIX_FMT_NONE; i++)
  79. - if (IS_VDPAU_PIX_FMT(fmt[i]))
  80. - break;
  81. + while(*cur != PIX_FMT_NONE)
  82. + {
  83. + if (*cur == AV_PIX_FMT_VDPAU)
  84. + return *cur;
  85. + cur++;
  86. + }
  87. + LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("cur=%1 ori:%2 (FMT_NONE:%3)")
  88. + .arg(*cur).arg(*fmt).arg(*cur == PIX_FMT_NONE));
  89.  
  90. - return fmt[i];
  91. + return avcodec_default_get_format(avctx, fmt);
  92. }
  93.  
  94. // Declared seperately to allow attribute
  95. @@ -1517,8 +1528,8 @@ void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc,
  96.  
  97. AVCodec *codec = avcodec_find_decoder(enc->codec_id);
  98. // look for a vdpau capable codec
  99. - if (codec_is_vdpau(video_codec_id) && !CODEC_IS_VDPAU(codec))
  100. - codec = find_vdpau_decoder(codec, enc->codec_id);
  101. + //if (codec_is_vdpau(video_codec_id) && !CODEC_IS_VDPAU(codec))
  102. + // codec = find_vdpau_decoder(codec, enc->codec_id);
  103.  
  104. if (selectedStream)
  105. {
  106. @@ -1535,7 +1546,7 @@ void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc,
  107. if (metatag && metatag->value && QString("180") == metatag->value)
  108. video_inverted = true;
  109.  
  110. - if (CODEC_IS_VDPAU(codec))
  111. + if (1) //CODEC_IS_VDPAU(codec, enc))
  112. {
  113. enc->get_buffer = get_avf_buffer_vdpau;
  114. enc->get_format = get_format_vdpau;
  115. @@ -2450,10 +2461,10 @@ int AvFormatDecoder::ScanStreams(bool novideo)
  116. QString("Using %1 for video decoding")
  117. .arg(GetCodecDecoderName()));
  118.  
  119. - if (codec_is_vdpau(video_codec_id) && !CODEC_IS_VDPAU(codec))
  120. - {
  121. - codec = find_vdpau_decoder(codec, enc->codec_id);
  122. - }
  123. +// if (codec_is_vdpau(video_codec_id) && !CODEC_IS_VDPAU(codec, enc))
  124. +// {
  125. +// codec = find_vdpau_decoder(codec, enc->codec_id);
  126. +// }
  127.  
  128. if (!enc->codec)
  129. {
  130. @@ -2815,8 +2826,7 @@ int get_avf_buffer_vdpau(struct AVCodecContext *c, AVFrame *pic)
  131. VideoFrame *frame = nd->GetPlayer()->GetNextVideoFrame();
  132.  
  133. pic->data[0] = frame->buf;
  134. - pic->data[1] = frame->priv[0];
  135. - pic->data[2] = frame->priv[1];
  136. + pic->data[1] = pic->data[2] = NULL;
  137.  
  138. pic->linesize[0] = 0;
  139. pic->linesize[1] = 0;
  140. @@ -2830,6 +2840,12 @@ int get_avf_buffer_vdpau(struct AVCodecContext *c, AVFrame *pic)
  141. #ifdef USING_VDPAU
  142. struct vdpau_render_state *render = (struct vdpau_render_state *)frame->buf;
  143. render->state |= FF_VDPAU_STATE_USED_FOR_REFERENCE;
  144. + pic->data[3] = (uint8_t*)(uintptr_t)render->surface;
  145. + static uint8_t *dummy[1] = { 0 };
  146. + if (nd->GetPlayer())
  147. + {
  148. + c->hwaccel_context = nd->GetPlayer()->GetDecoderContext(NULL, dummy[0]);
  149. + }
  150. #endif
  151.  
  152. pic->reordered_opaque = c->reordered_opaque;
  153. diff --git a/mythtv/libs/libmythtv/mythcodecid.h b/mythtv/libs/libmythtv/mythcodecid.h
  154. index 0f28bfd..0fedfed 100644
  155. --- a/mythtv/libs/libmythtv/mythcodecid.h
  156. +++ b/mythtv/libs/libmythtv/mythcodecid.h
  157. @@ -103,11 +103,10 @@ int mpeg_version(int codec_id);
  158. #define CODEC_IS_H264(id) (mpeg_version(id) == 5)
  159. #define CODEC_IS_MPEG(id) (mpeg_version(id) && mpeg_version(id) <= 2)
  160. #define CODEC_IS_FFMPEG_MPEG(id) (CODEC_IS_MPEG(id))
  161. -#define CODEC_IS_VDPAU(codec) (codec &&\
  162. - codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
  163. +#define CODEC_IS_VDPAU(codec, enc) (codec && IS_VDPAU_PIX_FMT(enc->pix_fmt))
  164. #define CODEC_IS_VAAPI(codec, enc) (codec && IS_VAAPI_PIX_FMT(enc->pix_fmt))
  165. #define CODEC_IS_DXVA2(codec, enc) (codec && (enc->pix_fmt == PIX_FMT_DXVA2_VLD))
  166. -#define CODEC_IS_HWACCEL(codec, enc) (CODEC_IS_VDPAU(codec) ||\
  167. +#define CODEC_IS_HWACCEL(codec, enc) (CODEC_IS_VDPAU(codec, enc) || \
  168. CODEC_IS_VAAPI(codec, enc) ||\
  169. CODEC_IS_DXVA2(codec, enc))
  170.  
  171. diff --git a/mythtv/libs/libmythtv/videoout_nullvdpau.cpp b/mythtv/libs/libmythtv/videoout_nullvdpau.cpp
  172. index 3f23cef..26febf4 100644
  173. --- a/mythtv/libs/libmythtv/videoout_nullvdpau.cpp
  174. +++ b/mythtv/libs/libmythtv/videoout_nullvdpau.cpp
  175. @@ -29,6 +29,7 @@ VideoOutputNullVDPAU::VideoOutputNullVDPAU()
  176. m_checked_surface_ownership(false), m_shadowBuffers(NULL),
  177. m_surfaceSize(QSize(0,0))
  178. {
  179. + m_context.bitstream_buffers_allocated = 0;
  180. }
  181.  
  182. VideoOutputNullVDPAU::~VideoOutputNullVDPAU()
  183. @@ -72,8 +73,16 @@ bool VideoOutputNullVDPAU::Init(const QSize &video_dim_buf,
  184. bool VideoOutputNullVDPAU::InitRender(void)
  185. {
  186. QMutexLocker locker(&m_lock);
  187. +
  188. + if (m_context.bitstream_buffers_allocated)
  189. + {
  190. + av_freep(&m_context.bitstream_buffers);
  191. + }
  192. + memset(&m_context, 0, sizeof(AVVDPAUContext));
  193. + m_context.render = Render;
  194. +
  195. m_render = new MythRenderVDPAU();
  196. - if (m_render && m_render->CreateDecodeOnly())
  197. + if (m_render->CreateDecodeOnly())
  198. return true;
  199. LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to initialise VDPAU");
  200. return false;
  201. @@ -90,8 +99,13 @@ void VideoOutputNullVDPAU::DeleteRender(void)
  202. }
  203.  
  204. m_decoder = 0;
  205. - m_render = NULL;
  206. + m_render = NULL;
  207. m_pix_fmt = -1;
  208. + if (m_context.bitstream_buffers_allocated)
  209. + {
  210. + av_freep(&m_context.bitstream_buffers);
  211. + m_context.bitstream_buffers_allocated = 0;
  212. + }
  213. }
  214.  
  215. bool VideoOutputNullVDPAU::InitBuffers(void)
  216. @@ -269,9 +283,9 @@ void VideoOutputNullVDPAU::DrawSlice(VideoFrame *frame, int x, int y, int w, int
  217. }
  218.  
  219. uint max_refs = MIN_REFERENCE_FRAMES;
  220. - if (frame->pix_fmt == PIX_FMT_VDPAU_H264)
  221. + if (video_codec_id == kCodec_H264_VDPAU)
  222. {
  223. - max_refs = render->info.h264.num_ref_frames;
  224. + max_refs = m_context.info.h264.num_ref_frames;
  225. if (max_refs < 1 || max_refs > MAX_REFERENCE_FRAMES)
  226. {
  227. uint32_t round_width = (frame->width + 15) & ~15;
  228. @@ -321,29 +335,29 @@ void VideoOutputNullVDPAU::DrawSlice(VideoFrame *frame, int x, int y, int w, int
  229. }
  230.  
  231. VdpDecoderProfile vdp_decoder_profile;
  232. - switch (frame->pix_fmt)
  233. + switch (video_codec_id)
  234. {
  235. - case PIX_FMT_VDPAU_MPEG1:
  236. + case kCodec_MPEG1_VDPAU:
  237. vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG1;
  238. break;
  239. - case PIX_FMT_VDPAU_MPEG2:
  240. + case kCodec_MPEG2_VDPAU:
  241. vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
  242. break;
  243. - case PIX_FMT_VDPAU_MPEG4:
  244. + case kCodec_MPEG4_VDPAU:
  245. vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
  246. break;
  247. - case PIX_FMT_VDPAU_H264:
  248. + case kCodec_H264_VDPAU:
  249. vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH;
  250. break;
  251. - case PIX_FMT_VDPAU_WMV3:
  252. + case kCodec_WMV3_VDPAU:
  253. vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_MAIN;
  254. break;
  255. - case PIX_FMT_VDPAU_VC1:
  256. + case kCodec_VC1_VDPAU:
  257. vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
  258. break;
  259. default:
  260. LOG(VB_GENERAL, LOG_ERR, LOC +
  261. - "Picture format is not supported.");
  262. + "Codec is not supported.");
  263. errorState = kError_Unknown;
  264. return;
  265. }
  266. @@ -372,7 +386,7 @@ void VideoOutputNullVDPAU::DrawSlice(VideoFrame *frame, int x, int y, int w, int
  267. return;
  268. }
  269.  
  270. - m_render->Decode(m_decoder, render);
  271. + m_render->Decode(m_decoder, render, &m_context);
  272. }
  273.  
  274. void VideoOutputNullVDPAU::ClearAfterSeek(void)
  275. @@ -613,3 +627,17 @@ bool VideoOutputNullVDPAU::BufferSizeCheck(void)
  276. }
  277. return true;
  278. }
  279. +
  280. +
  281. +void* VideoOutputNullVDPAU::GetDecoderContext(unsigned char* buf, uint8_t*& id)
  282. +{
  283. + return &m_context;
  284. +}
  285. +
  286. +VdpStatus VideoOutputNullVDPAU::Render(VdpDecoder decoder, VdpVideoSurface target,
  287. + VdpPictureInfo const *picture_info,
  288. + uint32_t bitstream_buffer_count,
  289. + VdpBitstreamBuffer const *bitstream_buffers)
  290. +{
  291. + return VDP_STATUS_OK;
  292. +}
  293. diff --git a/mythtv/libs/libmythtv/videoout_nullvdpau.h b/mythtv/libs/libmythtv/videoout_nullvdpau.h
  294. index e6776a1..e128846 100644
  295. --- a/mythtv/libs/libmythtv/videoout_nullvdpau.h
  296. +++ b/mythtv/libs/libmythtv/videoout_nullvdpau.h
  297. @@ -39,6 +39,7 @@ class VideoOutputNullVDPAU : public VideoOutput
  298. const QSize &video_dim_disp,
  299. float aspect, WId winid,
  300. const QRect &win_rect, MythCodecID codec_id);
  301. + virtual void* GetDecoderContext(unsigned char* buf, uint8_t*& id);
  302. virtual bool InputChanged(const QSize &video_dim_buf,
  303. const QSize &video_dim_disp,
  304. float aspect,
  305. @@ -70,6 +71,10 @@ class VideoOutputNullVDPAU : public VideoOutput
  306. const QString &name) { return false; }
  307. virtual MythPainter *GetOSDPainter(void) { return NULL; }
  308. virtual void DrawSlice(VideoFrame *frame, int x, int y, int w, int h);
  309. + static VdpStatus Render(VdpDecoder decoder, VdpVideoSurface target,
  310. + VdpPictureInfo const *picture_info,
  311. + uint32_t bitstream_buffer_count,
  312. + VdpBitstreamBuffer const *bitstream_buffers);
  313.  
  314. virtual VideoFrame *GetLastDecodedFrame(void);
  315. virtual VideoFrame *GetLastShownFrame(void);
  316. @@ -93,6 +98,7 @@ class VideoOutputNullVDPAU : public VideoOutput
  317.  
  318. private:
  319. MythRenderVDPAU *m_render;
  320. + AVVDPAUContext m_context;
  321. QMutex m_lock;
  322. uint m_decoder;
  323. int m_pix_fmt;
  324. diff --git a/mythtv/libs/libmythtv/videoout_vdpau.cpp b/mythtv/libs/libmythtv/videoout_vdpau.cpp
  325. index 17f1282..fb14790 100644
  326. --- a/mythtv/libs/libmythtv/videoout_vdpau.cpp
  327. +++ b/mythtv/libs/libmythtv/videoout_vdpau.cpp
  328. @@ -67,6 +67,7 @@ VideoOutputVDPAU::VideoOutputVDPAU()
  329. {
  330. if (gCoreContext->GetNumSetting("UseVideoModes", 0))
  331. display_res = DisplayRes::GetDisplayRes(true);
  332. + m_context.bitstream_buffers_allocated = 0;
  333. }
  334.  
  335. VideoOutputVDPAU::~VideoOutputVDPAU()
  336. @@ -83,6 +84,11 @@ void VideoOutputVDPAU::TearDown(void)
  337. DeleteBuffers();
  338. RestoreDisplay();
  339. DeleteRender();
  340. + if (m_context.bitstream_buffers_allocated)
  341. + {
  342. + av_freep(&m_context.bitstream_buffers);
  343. + m_context.bitstream_buffers_allocated = 0;
  344. + }
  345. }
  346.  
  347. bool VideoOutputVDPAU::Init(const QSize &video_dim_buf,
  348. @@ -101,7 +107,7 @@ bool VideoOutputVDPAU::Init(const QSize &video_dim_buf,
  349. QMutexLocker locker(&m_lock);
  350. window.SetNeedRepaint(true);
  351. bool ok = VideoOutput::Init(video_dim_buf, video_dim_disp,
  352. - aspect, winid, win_rect,codec_id);
  353. + aspect, winid, win_rect, codec_id);
  354. if (db_vdisp_profile)
  355. db_vdisp_profile->SetVideoRenderer("vdpau");
  356.  
  357. @@ -130,9 +136,16 @@ bool VideoOutputVDPAU::InitRender(void)
  358. QMutexLocker locker(&m_lock);
  359.  
  360. const QSize size = window.GetDisplayVisibleRect().size();
  361. - m_render = new MythRenderVDPAU();
  362.  
  363. - if (m_render && m_render->Create(size, m_win))
  364. + if (m_context.bitstream_buffers_allocated)
  365. + {
  366. + av_freep(&m_context.bitstream_buffers);
  367. + }
  368. + memset(&m_context, 0, sizeof(AVVDPAUContext));
  369. + m_context.render = Render;
  370. +
  371. + m_render = new MythRenderVDPAU();
  372. + if (m_render->Create(size, m_win))
  373. {
  374. m_osd_painter = new MythVDPAUPainter(m_render);
  375. if (m_osd_painter)
  376. @@ -587,9 +600,9 @@ void VideoOutputVDPAU::DrawSlice(VideoFrame *frame, int x, int y, int w, int h)
  377. }
  378.  
  379. uint max_refs = MIN_REFERENCE_FRAMES;
  380. - if (frame->pix_fmt == PIX_FMT_VDPAU_H264)
  381. + if (video_codec_id == kCodec_H264_VDPAU)
  382. {
  383. - max_refs = render->info.h264.num_ref_frames;
  384. + max_refs = m_context.info.h264.num_ref_frames;
  385. if (max_refs < 1 || max_refs > MAX_REFERENCE_FRAMES)
  386. {
  387. uint32_t round_width = (frame->width + 15) & ~15;
  388. @@ -633,29 +646,29 @@ void VideoOutputVDPAU::DrawSlice(VideoFrame *frame, int x, int y, int w, int h)
  389. }
  390.  
  391. VdpDecoderProfile vdp_decoder_profile;
  392. - switch (frame->pix_fmt)
  393. + switch (video_codec_id)
  394. {
  395. - case PIX_FMT_VDPAU_MPEG1:
  396. + case kCodec_MPEG1_VDPAU:
  397. vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG1;
  398. break;
  399. - case PIX_FMT_VDPAU_MPEG2:
  400. + case kCodec_MPEG2_VDPAU:
  401. vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
  402. break;
  403. - case PIX_FMT_VDPAU_MPEG4:
  404. + case kCodec_MPEG4_VDPAU:
  405. vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
  406. break;
  407. - case PIX_FMT_VDPAU_H264:
  408. + case kCodec_H264_VDPAU:
  409. vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH;
  410. break;
  411. - case PIX_FMT_VDPAU_WMV3:
  412. + case kCodec_WMV3_VDPAU:
  413. vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_MAIN;
  414. break;
  415. - case PIX_FMT_VDPAU_VC1:
  416. + case kCodec_VC1_VDPAU:
  417. vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
  418. break;
  419. default:
  420. LOG(VB_GENERAL, LOG_ERR, LOC +
  421. - "Picture format is not supported.");
  422. + "Codec is not supported.");
  423. errorState = kError_Unknown;
  424. return;
  425. }
  426. @@ -684,7 +697,7 @@ void VideoOutputVDPAU::DrawSlice(VideoFrame *frame, int x, int y, int w, int h)
  427. return;
  428. }
  429.  
  430. - m_render->Decode(m_decoder, render);
  431. + m_render->Decode(m_decoder, render, &m_context);
  432. }
  433.  
  434. void VideoOutputVDPAU::Show(FrameScanType scan)
  435. @@ -1327,3 +1340,16 @@ void VideoOutputVDPAU::SetVideoFlip(void)
  436. }
  437. m_render->SetVideoFlip();
  438. }
  439. +
  440. +void* VideoOutputVDPAU::GetDecoderContext(unsigned char* buf, uint8_t*& id)
  441. +{
  442. + return &m_context;
  443. +}
  444. +
  445. +VdpStatus VideoOutputVDPAU::Render(VdpDecoder decoder, VdpVideoSurface target,
  446. + VdpPictureInfo const *picture_info,
  447. + uint32_t bitstream_buffer_count,
  448. + VdpBitstreamBuffer const *bitstream_buffers)
  449. +{
  450. + return VDP_STATUS_OK;
  451. +}
  452. diff --git a/mythtv/libs/libmythtv/videoout_vdpau.h b/mythtv/libs/libmythtv/videoout_vdpau.h
  453. index 0511ab4..cead864 100644
  454. --- a/mythtv/libs/libmythtv/videoout_vdpau.h
  455. +++ b/mythtv/libs/libmythtv/videoout_vdpau.h
  456. @@ -25,6 +25,7 @@ class VideoOutputVDPAU : public VideoOutput
  457. const QSize &video_dim_disp,
  458. float aspect,
  459. WId winid, const QRect &win_rect, MythCodecID codec_id);
  460. + virtual void* GetDecoderContext(unsigned char* buf, uint8_t*& id);
  461. bool SetDeinterlacingEnabled(bool interlaced);
  462. bool SetupDeinterlace(bool interlaced, const QString& ovrf="");
  463. bool ApproveDeintFilter(const QString& filtername) const;
  464. @@ -34,6 +35,10 @@ class VideoOutputVDPAU : public VideoOutput
  465. FrameScanType scan);
  466. void PrepareFrame(VideoFrame*, FrameScanType, OSD *osd);
  467. void DrawSlice(VideoFrame*, int x, int y, int w, int h);
  468. + static VdpStatus Render(VdpDecoder decoder, VdpVideoSurface target,
  469. + VdpPictureInfo const *picture_info,
  470. + uint32_t bitstream_buffer_count,
  471. + VdpBitstreamBuffer const *bitstream_buffers);
  472. void Show(FrameScanType);
  473. void ClearAfterSeek(void);
  474. bool InputChanged(const QSize &video_dim_buf,
  475. @@ -105,6 +110,7 @@ class VideoOutputVDPAU : public VideoOutput
  476.  
  477. Window m_win;
  478. MythRenderVDPAU *m_render;
  479. + AVVDPAUContext m_context;
  480.  
  481. uint m_decoder_buffer_size;
  482. uint m_process_buffer_size;
  483. @@ -136,5 +142,3 @@ class VideoOutputVDPAU : public VideoOutput
  484. };
  485.  
  486. #endif // VIDEOOUT_VDPAU_H
  487. -
  488. -
  489. diff --git a/mythtv/libs/libmythui/mythrender_vdpau.cpp b/mythtv/libs/libmythui/mythrender_vdpau.cpp
  490. index 1161355..3bbfcd8 100644
  491. --- a/mythtv/libs/libmythui/mythrender_vdpau.cpp
  492. +++ b/mythtv/libs/libmythui/mythrender_vdpau.cpp
  493. @@ -1515,7 +1515,8 @@ void MythRenderVDPAU::ChangeVideoSurfaceOwner(uint id)
  494. m_videoSurfaces[id].m_owner = QThread::currentThread();
  495. }
  496.  
  497. -void MythRenderVDPAU::Decode(uint id, struct vdpau_render_state *render)
  498. +void MythRenderVDPAU::Decode(uint id, struct vdpau_render_state *render,
  499. + AVVDPAUContext *context)
  500. {
  501. CHECK_VIDEO_SURFACES()
  502.  
  503. @@ -1528,9 +1529,9 @@ void MythRenderVDPAU::Decode(uint id, struct vdpau_render_state *render)
  504.  
  505. INIT_ST
  506. vdp_st = vdp_decoder_render(m_decoders[id].m_id, render->surface,
  507. - (VdpPictureInfo const *)&(render->info),
  508. - render->bitstream_buffers_used,
  509. - render->bitstream_buffers);
  510. + (VdpPictureInfo const *)&(context->info),
  511. + context->bitstream_buffers_used,
  512. + context->bitstream_buffers);
  513. CHECK_ST
  514. }
  515.  
  516. diff --git a/mythtv/libs/libmythui/mythrender_vdpau.h b/mythtv/libs/libmythui/mythrender_vdpau.h
  517. index c14baab..7b924f4 100644
  518. --- a/mythtv/libs/libmythui/mythrender_vdpau.h
  519. +++ b/mythtv/libs/libmythui/mythrender_vdpau.h
  520. @@ -134,7 +134,8 @@ class MUI_PUBLIC MythRenderVDPAU : public MythRender
  521. void ClearVideoSurface(uint id);
  522. void ChangeVideoSurfaceOwner(uint id);
  523.  
  524. - void Decode(uint id, struct vdpau_render_state *render);
  525. + void Decode(uint id, struct vdpau_render_state *render,
  526. + AVVDPAUContext *context);
  527. void SetVideoFlip(void) { m_flipFrames = true; }
  528.  
  529. private:
Advertisement
Add Comment
Please, Sign In to add comment