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

Unified Diff: media/video/ffmpeg_video_decode_engine.cc

Issue 7587012: Remove mock_ffmpeg and update media unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: media/video/ffmpeg_video_decode_engine.cc
diff --git a/media/video/ffmpeg_video_decode_engine.cc b/media/video/ffmpeg_video_decode_engine.cc
index 4af73a188cae27d86be40ebc0e940f96ccaaa5f1..9ee02da2fc20dc2cbfa6e398bac875044882847c 100644
--- a/media/video/ffmpeg_video_decode_engine.cc
+++ b/media/video/ffmpeg_video_decode_engine.cc
@@ -120,6 +120,7 @@ void FFmpegVideoDecodeEngine::Initialize(
kNoTimestamp);
frame_queue_available_.push_back(video_frame);
}
+
codec_context_->thread_count = decode_threads;
if (codec &&
avcodec_open(codec_context_, codec) >= 0 &&
@@ -132,6 +133,18 @@ void FFmpegVideoDecodeEngine::Initialize(
void FFmpegVideoDecodeEngine::ConsumeVideoSample(
scoped_refptr<Buffer> buffer) {
+ static int i = -1;
+
+ if (i >= 0) {
scherkus (not reviewing) 2011/08/11 01:26:29 woah!?? what's all this doing
acolwell GONE FROM CHROMIUM 2011/08/11 23:54:40 Oops. This is how I was extracting data for test f
+ char filename[100];
+ sprintf(filename, "vp8-frame-%d", i++);
+ printf("%s\n", filename);
+ FILE* f = fopen(filename, "wb");
+ DCHECK(f);
+ fwrite(buffer->GetData(), buffer->GetDataSize(), 1, f);
+ fclose(f);
+ }
+
pending_input_buffers_--;
if (flush_pending_) {
TryToFinishPendingFlush();
@@ -186,7 +199,6 @@ void FFmpegVideoDecodeEngine::DecodeFrame(scoped_refptr<Buffer> buffer) {
av_frame_.get(),
&frame_decoded,
&packet);
-
// Log the problem if we can't decode a video frame and exit early.
if (result < 0) {
LOG(ERROR) << "Error decoding a video frame with timestamp: "
@@ -303,24 +315,6 @@ void FFmpegVideoDecodeEngine::ReadInput() {
event_handler_->ProduceVideoSample(NULL);
}
-VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const {
- // J (Motion JPEG) versions of YUV are full range 0..255.
- // Regular (MPEG) YUV is 16..240.
- // For now we will ignore the distinction and treat them the same.
- switch (codec_context_->pix_fmt) {
- case PIX_FMT_YUV420P:
- case PIX_FMT_YUVJ420P:
- return VideoFrame::YV12;
- case PIX_FMT_YUV422P:
- case PIX_FMT_YUVJ422P:
- return VideoFrame::YV16;
- default:
- // TODO(scherkus): More formats here?
- break;
- }
- return VideoFrame::INVALID;
-}
-
} // namespace media
// Disable refcounting for this object because this object only lives

Powered by Google App Engine
This is Rietveld 408576698