| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include "media/base/android/media_codec_decoder.h" | 9 #include "media/base/android/media_codec_decoder.h" |
| 10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 const base::Closure& codec_created_cb); | 37 const base::Closure& codec_created_cb); |
| 38 ~MediaCodecVideoDecoder() override; | 38 ~MediaCodecVideoDecoder() override; |
| 39 | 39 |
| 40 const char* class_name() const override; | 40 const char* class_name() const override; |
| 41 | 41 |
| 42 bool HasStream() const override; | 42 bool HasStream() const override; |
| 43 void SetDemuxerConfigs(const DemuxerConfigs& configs) override; | 43 void SetDemuxerConfigs(const DemuxerConfigs& configs) override; |
| 44 void ReleaseDecoderResources() override; | 44 void ReleaseDecoderResources() override; |
| 45 | 45 |
| 46 // Stores the video surface to use with upcoming Configure() | 46 // Stores the video surface to use with upcoming Configure() |
| 47 void SetPendingSurface(gfx::ScopedJavaSurface surface); | 47 void SetVideoSurface(gfx::ScopedJavaSurface surface); |
| 48 | 48 |
| 49 // Returns true if there is a video surface to use. | 49 // Returns true if there is a video surface to use. |
| 50 bool HasPendingSurface() const; | 50 bool HasVideoSurface() const; |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 bool IsCodecReconfigureNeeded(const DemuxerConfigs& curr, | 53 bool IsCodecReconfigureNeeded(const DemuxerConfigs& curr, |
| 54 const DemuxerConfigs& next) const override; | 54 const DemuxerConfigs& next) const override; |
| 55 ConfigStatus ConfigureInternal() override; | 55 ConfigStatus ConfigureInternal() override; |
| 56 void SynchronizePTSWithTime(base::TimeDelta current_time) override; | 56 void SynchronizePTSWithTime(base::TimeDelta current_time) override; |
| 57 void OnOutputFormatChanged() override; | 57 void OnOutputFormatChanged() override; |
| 58 void Render(int buffer_index, | 58 void Render(int buffer_index, |
| 59 size_t size, | 59 size_t size, |
| 60 bool render_output, | 60 bool render_output, |
| 61 base::TimeDelta pts, | 61 base::TimeDelta pts, |
| 62 bool eos_encountered) override; | 62 bool eos_encountered) override; |
| 63 | 63 |
| 64 int NumDelayedRenderTasks() const override; | 64 int NumDelayedRenderTasks() const override; |
| 65 void ReleaseDelayedBuffers() override; | 65 void ClearDelayedBuffers(bool release) override; |
| 66 | 66 |
| 67 #ifndef NDEBUG | 67 #ifndef NDEBUG |
| 68 void VerifyUnitIsKeyFrame(const AccessUnit* unit) const override; | 68 void VerifyUnitIsKeyFrame(const AccessUnit* unit) const override; |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // A helper method that releases output buffers and does | 72 // A helper method that releases output buffers and does |
| 73 // post-release checks. Might be called by Render() or posted | 73 // post-release checks. Might be called by Render() or posted |
| 74 // for later execution. | 74 // for later execution. |
| 75 void ReleaseOutputBuffer(int buffer_index, | 75 void ReleaseOutputBuffer(int buffer_index, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // Mantain the last seen PTS for stand-alone EOS. | 108 // Mantain the last seen PTS for stand-alone EOS. |
| 109 base::TimeDelta last_seen_pts_; | 109 base::TimeDelta last_seen_pts_; |
| 110 | 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(MediaCodecVideoDecoder); | 111 DISALLOW_COPY_AND_ASSIGN(MediaCodecVideoDecoder); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace media | 114 } // namespace media |
| 115 | 115 |
| 116 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_ | 116 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_ |
| OLD | NEW |