Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 113748: New FFmpeg public API headers to match our source tarball in deps. (Closed)
Patch Set: Fixes Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_demuxer_unittest.cc ('k') | third_party/ffmpeg/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 6d5505a42f92d6937846d365ce10280c62f1f62d..b80d2150a4ec5b22aac16d0f090447c9d05d63cb 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -81,17 +81,20 @@ void FFmpegVideoDecoder::OnDecode(Buffer* buffer) {
times.duration = buffer->GetDuration();
time_queue_.push(times);
- // Cast everything to FFmpeg types.
- const uint8_t* data_in = buffer->GetData();
- const size_t size_in = buffer->GetDataSize();
+ // Create a packet for input data.
+ // Due to FFmpeg API changes we no longer have const read-only pointers.
+ AVPacket packet;
+ av_init_packet(&packet);
+ packet.data = const_cast<uint8*>(buffer->GetData());
+ packet.size = buffer->GetDataSize();
// We don't allocate AVFrame on the stack since different versions of FFmpeg
// may change the size of AVFrame, causing stack corruption. The solution is
// to let FFmpeg allocate the structure via avcodec_alloc_frame().
int decoded = 0;
scoped_ptr_malloc<AVFrame, ScopedPtrAVFree> yuv_frame(avcodec_alloc_frame());
- int result = avcodec_decode_video(codec_context_, yuv_frame.get(), &decoded,
- data_in, size_in);
+ int result = avcodec_decode_video2(codec_context_, yuv_frame.get(), &decoded,
+ &packet);
// Log the problem if we can't decode a video frame.
if (result < 0) {
« no previous file with comments | « media/filters/ffmpeg_demuxer_unittest.cc ('k') | third_party/ffmpeg/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698