OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "media/base/demuxer_stream.h" |
12 #include "media/base/video_decoder.h" | 13 #include "media/base/video_decoder.h" |
13 | 14 |
14 class MessageLoop; | 15 class MessageLoop; |
15 | 16 |
16 struct AVCodecContext; | 17 struct AVCodecContext; |
17 struct AVFrame; | 18 struct AVFrame; |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 class DecoderBuffer; | 22 class DecoderBuffer; |
(...skipping 25 matching lines...) Expand all Loading... |
47 kNormal, | 48 kNormal, |
48 kFlushCodec, | 49 kFlushCodec, |
49 kDecodeFinished, | 50 kDecodeFinished, |
50 }; | 51 }; |
51 | 52 |
52 // Carries out the reading operation scheduled by Read(). | 53 // Carries out the reading operation scheduled by Read(). |
53 void DoRead(const ReadCB& read_cb); | 54 void DoRead(const ReadCB& read_cb); |
54 | 55 |
55 // Reads from the demuxer stream with corresponding callback method. | 56 // Reads from the demuxer stream with corresponding callback method. |
56 void ReadFromDemuxerStream(); | 57 void ReadFromDemuxerStream(); |
57 void DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer); | 58 void DecodeBuffer(DemuxerStream::Status status, |
| 59 const scoped_refptr<DecoderBuffer>& buffer); |
58 | 60 |
59 // Carries out the decoding operation scheduled by DecodeBuffer(). | 61 // Carries out the decoding operation scheduled by DecodeBuffer(). |
60 void DoDecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer); | 62 void DoDecodeBuffer(DemuxerStream::Status status, |
| 63 const scoped_refptr<DecoderBuffer>& buffer); |
61 bool Decode(const scoped_refptr<DecoderBuffer>& buffer, | 64 bool Decode(const scoped_refptr<DecoderBuffer>& buffer, |
62 scoped_refptr<VideoFrame>* video_frame); | 65 scoped_refptr<VideoFrame>* video_frame); |
63 | 66 |
64 // Delivers the frame to |read_cb_| and resets the callback. | 67 // Delivers the frame to |read_cb_| and resets the callback. |
65 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); | 68 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); |
66 | 69 |
67 // Releases resources associated with |codec_context_| and |av_frame_| | 70 // Releases resources associated with |codec_context_| and |av_frame_| |
68 // and resets them to NULL. | 71 // and resets them to NULL. |
69 void ReleaseFFmpegResources(); | 72 void ReleaseFFmpegResources(); |
70 | 73 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 scoped_refptr<DemuxerStream> demuxer_stream_; | 106 scoped_refptr<DemuxerStream> demuxer_stream_; |
104 | 107 |
105 Decryptor* decryptor_; | 108 Decryptor* decryptor_; |
106 | 109 |
107 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 110 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
108 }; | 111 }; |
109 | 112 |
110 } // namespace media | 113 } // namespace media |
111 | 114 |
112 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 115 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
OLD | NEW |