OLD | NEW |
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/video/ffmpeg_video_decode_engine.h" | 5 #include "media/video/ffmpeg_video_decode_engine.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/task.h" | 9 #include "base/task.h" |
10 #include "media/base/buffers.h" | 10 #include "media/base/buffers.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // After a seek, output stream no longer considered as EOS. | 324 // After a seek, output stream no longer considered as EOS. |
325 output_eos_reached_ = false; | 325 output_eos_reached_ = false; |
326 | 326 |
327 // The buffer provider is assumed to perform pre-roll operation. | 327 // The buffer provider is assumed to perform pre-roll operation. |
328 for (unsigned int i = 0; i < Limits::kMaxVideoFrames; ++i) | 328 for (unsigned int i = 0; i < Limits::kMaxVideoFrames; ++i) |
329 ReadInput(); | 329 ReadInput(); |
330 | 330 |
331 event_handler_->OnSeekComplete(); | 331 event_handler_->OnSeekComplete(); |
332 } | 332 } |
333 | 333 |
| 334 AVCodecContext* FFmpegVideoDecodeEngine::codec_context() const { |
| 335 return codec_context_; |
| 336 } |
| 337 |
| 338 void FFmpegVideoDecodeEngine::SetCodecContextForTest(AVCodecContext* context) { |
| 339 codec_context_ = context; |
| 340 } |
| 341 |
334 void FFmpegVideoDecodeEngine::ReadInput() { | 342 void FFmpegVideoDecodeEngine::ReadInput() { |
335 DCHECK_EQ(output_eos_reached_, false); | 343 DCHECK_EQ(output_eos_reached_, false); |
336 pending_input_buffers_++; | 344 pending_input_buffers_++; |
337 event_handler_->ProduceVideoSample(NULL); | 345 event_handler_->ProduceVideoSample(NULL); |
338 } | 346 } |
339 | 347 |
340 VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const { | 348 VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const { |
341 // J (Motion JPEG) versions of YUV are full range 0..255. | 349 // J (Motion JPEG) versions of YUV are full range 0..255. |
342 // Regular (MPEG) YUV is 16..240. | 350 // Regular (MPEG) YUV is 16..240. |
343 // For now we will ignore the distinction and treat them the same. | 351 // For now we will ignore the distinction and treat them the same. |
(...skipping 10 matching lines...) Expand all Loading... |
354 // TODO(scherkus): More formats here? | 362 // TODO(scherkus): More formats here? |
355 return VideoFrame::INVALID; | 363 return VideoFrame::INVALID; |
356 } | 364 } |
357 } | 365 } |
358 | 366 |
359 } // namespace media | 367 } // namespace media |
360 | 368 |
361 // Disable refcounting for this object because this object only lives | 369 // Disable refcounting for this object because this object only lives |
362 // on the video decoder thread and there's no need to refcount it. | 370 // on the video decoder thread and there's no need to refcount it. |
363 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::FFmpegVideoDecodeEngine); | 371 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::FFmpegVideoDecodeEngine); |
OLD | NEW |