| 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_OMX_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_OMX_VIDEO_DECODER_H_ |
| 6 #define MEDIA_FILTERS_OMX_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_OMX_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "media/base/filters.h" | 10 #include "media/base/filters.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 static FilterFactory* CreateFactory(); | 24 static FilterFactory* CreateFactory(); |
| 25 static bool IsMediaFormatSupported(const MediaFormat& media_format); | 25 static bool IsMediaFormatSupported(const MediaFormat& media_format); |
| 26 | 26 |
| 27 OmxVideoDecoder(OmxVideoDecodeEngine* engine); | 27 OmxVideoDecoder(OmxVideoDecodeEngine* engine); |
| 28 virtual ~OmxVideoDecoder(); | 28 virtual ~OmxVideoDecoder(); |
| 29 | 29 |
| 30 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback); | 30 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback); |
| 31 virtual void Stop(FilterCallback* callback); | 31 virtual void Stop(FilterCallback* callback); |
| 32 virtual void Pause(FilterCallback* callback); | 32 virtual void Pause(FilterCallback* callback); |
| 33 virtual void Flush(FilterCallback* callback); |
| 33 virtual void Seek(base::TimeDelta time, FilterCallback* callback); | 34 virtual void Seek(base::TimeDelta time, FilterCallback* callback); |
| 34 virtual void FillThisBuffer(scoped_refptr<VideoFrame> frame); | 35 virtual void FillThisBuffer(scoped_refptr<VideoFrame> frame); |
| 36 virtual bool ProvidesBuffer(); |
| 35 virtual const MediaFormat& media_format() { return media_format_; } | 37 virtual const MediaFormat& media_format() { return media_format_; } |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 virtual void DoInitialize(DemuxerStream* stream, FilterCallback* callback); | 40 virtual void DoInitialize(DemuxerStream* stream, FilterCallback* callback); |
| 39 | 41 |
| 40 // Called after the decode engine has successfully decoded something. | 42 // Called after the decode engine has successfully decoded something. |
| 41 void FillBufferCallback(scoped_refptr<VideoFrame> frame); | 43 void FillBufferCallback(scoped_refptr<VideoFrame> frame); |
| 42 | 44 |
| 43 // Called after the decode engine has consumed an input buffer. | 45 // Called after the decode engine has consumed an input buffer. |
| 44 void EmptyBufferCallback(scoped_refptr<Buffer> buffer); | 46 void EmptyBufferCallback(scoped_refptr<Buffer> buffer); |
| 45 | 47 |
| 46 void InitCompleteTask(FilterCallback* callback); | 48 void InitCompleteTask(FilterCallback* callback); |
| 47 | 49 |
| 48 void StopCompleteTask(FilterCallback* callback); | 50 void StopCompleteTask(FilterCallback* callback); |
| 49 void PauseCompleteTask(FilterCallback* callback); | 51 void PauseCompleteTask(FilterCallback* callback); |
| 52 void FlushCompleteTask(FilterCallback* callback); |
| 50 void SeekCompleteTask(FilterCallback* callback); | 53 void SeekCompleteTask(FilterCallback* callback); |
| 51 | 54 |
| 52 // TODO(hclam): This is very ugly that we keep reference instead of | 55 // TODO(hclam): This is very ugly that we keep reference instead of |
| 53 // scoped_refptr. | 56 // scoped_refptr. |
| 54 void DemuxCompleteTask(Buffer* buffer); | 57 void DemuxCompleteTask(Buffer* buffer); |
| 55 | 58 |
| 56 // Calls |omx_engine_|'s EmptyThisBuffer() method on the right thread. | 59 // Calls |omx_engine_|'s EmptyThisBuffer() method on the right thread. |
| 57 void EmptyBufferTask(scoped_refptr<Buffer> buffer); | 60 void EmptyBufferTask(scoped_refptr<Buffer> buffer); |
| 58 | 61 |
| 59 DemuxerStream* demuxer_stream_; | 62 DemuxerStream* demuxer_stream_; |
| 60 bool supports_egl_image_; | 63 bool supports_egl_image_; |
| 61 scoped_refptr<OmxVideoDecodeEngine> omx_engine_; | 64 scoped_refptr<OmxVideoDecodeEngine> omx_engine_; |
| 62 MediaFormat media_format_; | 65 MediaFormat media_format_; |
| 63 size_t width_; | 66 size_t width_; |
| 64 size_t height_; | 67 size_t height_; |
| 65 | 68 |
| 66 DISALLOW_COPY_AND_ASSIGN(OmxVideoDecoder); | 69 DISALLOW_COPY_AND_ASSIGN(OmxVideoDecoder); |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 } // namespace media | 72 } // namespace media |
| 70 | 73 |
| 71 #endif // MEDIA_FILTERS_OMX_VIDEO_DECODER_H_ | 74 #endif // MEDIA_FILTERS_OMX_VIDEO_DECODER_H_ |
| OLD | NEW |