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

Side by Side Diff: media/filters/ffmpeg_video_decode_engine.cc

Issue 3169009: Merge 55596 - Fix av sync for webm files with altref video frames. Altref fra... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decode_engine_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/ffmpeg_video_decode_engine.h" 5 #include "media/filters/ffmpeg_video_decode_engine.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "media/base/buffers.h" 9 #include "media/base/buffers.h"
10 #include "media/base/callback.h" 10 #include "media/base/callback.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Create a packet for input data. 125 // Create a packet for input data.
126 // Due to FFmpeg API changes we no longer have const read-only pointers. 126 // Due to FFmpeg API changes we no longer have const read-only pointers.
127 AVPacket packet; 127 AVPacket packet;
128 av_init_packet(&packet); 128 av_init_packet(&packet);
129 packet.data = const_cast<uint8*>(buffer->GetData()); 129 packet.data = const_cast<uint8*>(buffer->GetData());
130 packet.size = buffer->GetDataSize(); 130 packet.size = buffer->GetDataSize();
131 131
132 // Let FFmpeg handle presentation timestamp reordering. 132 // Let FFmpeg handle presentation timestamp reordering.
133 codec_context_->reordered_opaque = buffer->GetTimestamp().InMicroseconds(); 133 codec_context_->reordered_opaque = buffer->GetTimestamp().InMicroseconds();
134 134
135 // This is for codecs not using get_buffer to initialize
136 // |av_frame_->reordered_opaque|
137 av_frame_->reordered_opaque = codec_context_->reordered_opaque;
138
135 int frame_decoded = 0; 139 int frame_decoded = 0;
136 int result = avcodec_decode_video2(codec_context_, 140 int result = avcodec_decode_video2(codec_context_,
137 av_frame_.get(), 141 av_frame_.get(),
138 &frame_decoded, 142 &frame_decoded,
139 &packet); 143 &packet);
140 144
141 // Log the problem if we can't decode a video frame and exit early. 145 // Log the problem if we can't decode a video frame and exit early.
142 if (result < 0) { 146 if (result < 0) {
143 LOG(INFO) << "Error decoding a video frame with timestamp: " 147 LOG(INFO) << "Error decoding a video frame with timestamp: "
144 << buffer->GetTimestamp().InMicroseconds() << " us" 148 << buffer->GetTimestamp().InMicroseconds() << " us"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 case PIX_FMT_YUVJ422P: 246 case PIX_FMT_YUVJ422P:
243 return VideoFrame::YV16; 247 return VideoFrame::YV16;
244 break; 248 break;
245 default: 249 default:
246 // TODO(scherkus): More formats here? 250 // TODO(scherkus): More formats here?
247 return VideoFrame::INVALID; 251 return VideoFrame::INVALID;
248 } 252 }
249 } 253 }
250 254
251 } // namespace media 255 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decode_engine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698