| 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 #ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| 6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" |
| 8 #include "base/time.h" | 9 #include "base/time.h" |
| 9 #include "media/base/pts_heap.h" | 10 #include "media/base/pts_heap.h" |
| 10 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
| 11 #include "media/filters/decoder_base.h" | 12 #include "media/filters/decoder_base.h" |
| 12 #include "testing/gtest/include/gtest/gtest_prod.h" | |
| 13 | 13 |
| 14 // FFmpeg types. | 14 // FFmpeg types. |
| 15 struct AVRational; | 15 struct AVRational; |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 class VideoDecodeEngine; | 19 class VideoDecodeEngine; |
| 20 | 20 |
| 21 class FFmpegVideoDecoder : public DecoderBase<VideoDecoder, VideoFrame> { | 21 class FFmpegVideoDecoder : public DecoderBase<VideoDecoder, VideoFrame> { |
| 22 public: | 22 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 virtual void DoDecode(Buffer* input); | 34 virtual void DoDecode(Buffer* input); |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 virtual void OnEmptyBufferDone(scoped_refptr<Buffer> buffer); | 37 virtual void OnEmptyBufferDone(scoped_refptr<Buffer> buffer); |
| 38 virtual void FillThisBuffer(scoped_refptr<VideoFrame> frame); | 38 virtual void FillThisBuffer(scoped_refptr<VideoFrame> frame); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 friend class FilterFactoryImpl1<FFmpegVideoDecoder, VideoDecodeEngine*>; | 41 friend class FilterFactoryImpl1<FFmpegVideoDecoder, VideoDecodeEngine*>; |
| 42 friend class DecoderPrivateMock; | 42 friend class DecoderPrivateMock; |
| 43 friend class FFmpegVideoDecoderTest; | 43 friend class FFmpegVideoDecoderTest; |
| 44 FRIEND_TEST(FFmpegVideoDecoderTest, FindPtsAndDuration); | 44 FRIEND_TEST_ALL_PREFIXES(FFmpegVideoDecoderTest, FindPtsAndDuration); |
| 45 FRIEND_TEST(FFmpegVideoDecoderTest, DoDecode_EnqueueVideoFrameError); | 45 FRIEND_TEST_ALL_PREFIXES(FFmpegVideoDecoderTest, |
| 46 FRIEND_TEST(FFmpegVideoDecoderTest, DoDecode_FinishEnqueuesEmptyFrames); | 46 DoDecode_EnqueueVideoFrameError); |
| 47 FRIEND_TEST(FFmpegVideoDecoderTest, DoDecode_TestStateTransition); | 47 FRIEND_TEST_ALL_PREFIXES(FFmpegVideoDecoderTest, |
| 48 FRIEND_TEST(FFmpegVideoDecoderTest, DoSeek); | 48 DoDecode_FinishEnqueuesEmptyFrames); |
| 49 FRIEND_TEST_ALL_PREFIXES(FFmpegVideoDecoderTest, |
| 50 DoDecode_TestStateTransition); |
| 51 FRIEND_TEST_ALL_PREFIXES(FFmpegVideoDecoderTest, DoSeek); |
| 49 | 52 |
| 50 // The TimeTuple struct is used to hold the needed timestamp data needed for | 53 // The TimeTuple struct is used to hold the needed timestamp data needed for |
| 51 // enqueuing a video frame. | 54 // enqueuing a video frame. |
| 52 struct TimeTuple { | 55 struct TimeTuple { |
| 53 base::TimeDelta timestamp; | 56 base::TimeDelta timestamp; |
| 54 base::TimeDelta duration; | 57 base::TimeDelta duration; |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 enum DecoderState { | 60 enum DecoderState { |
| 58 kNormal, | 61 kNormal, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 scoped_ptr<AVRational> time_base_; // Pointer to avoid needing full type. | 104 scoped_ptr<AVRational> time_base_; // Pointer to avoid needing full type. |
| 102 DecoderState state_; | 105 DecoderState state_; |
| 103 scoped_ptr<VideoDecodeEngine> decode_engine_; | 106 scoped_ptr<VideoDecodeEngine> decode_engine_; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 108 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 } // namespace media | 111 } // namespace media |
| 109 | 112 |
| 110 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 113 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| OLD | NEW |