Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: media/base/android/media_codec_video_decoder.h

Issue 1254293003: MediaCodecPlayer implementation (stage 4 - preroll) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-browserseek
Patch Set: Rebased Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 24 matching lines...) Expand all
35 const SetTimeCallback& update_current_time_cb, 35 const SetTimeCallback& update_current_time_cb,
36 const VideoSizeChangedCallback& video_size_changed_cb, 36 const VideoSizeChangedCallback& video_size_changed_cb,
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 void ReleaseMediaCodec() override;
45 46
46 // Stores the video surface to use with upcoming Configure() 47 // Stores the video surface to use with upcoming Configure()
47 void SetVideoSurface(gfx::ScopedJavaSurface surface); 48 void SetVideoSurface(gfx::ScopedJavaSurface surface);
48 49
49 // Returns true if there is a video surface to use. 50 // Returns true if there is a video surface to use.
50 bool HasVideoSurface() const; 51 bool HasVideoSurface() const;
51 52
52 protected: 53 protected:
53 bool IsCodecReconfigureNeeded(const DemuxerConfigs& curr, 54 bool IsCodecReconfigureNeeded(const DemuxerConfigs& curr,
54 const DemuxerConfigs& next) const override; 55 const DemuxerConfigs& next) const override;
55 ConfigStatus ConfigureInternal() override; 56 ConfigStatus ConfigureInternal() override;
56 void SynchronizePTSWithTime(base::TimeDelta current_time) override; 57 void AssociateCurrentTimeWithPTS(base::TimeDelta pts) override;
58 void DissociatePTSFromTime() override;
57 void OnOutputFormatChanged() override; 59 void OnOutputFormatChanged() override;
58 void Render(int buffer_index, 60 void Render(int buffer_index,
59 size_t size, 61 size_t size,
60 bool render_output, 62 RenderMode render_mode,
61 base::TimeDelta pts, 63 base::TimeDelta pts,
62 bool eos_encountered) override; 64 bool eos_encountered) override;
63 65
64 int NumDelayedRenderTasks() const override; 66 int NumDelayedRenderTasks() const override;
65 void ClearDelayedBuffers(bool release) override; 67 void ReleaseDelayedBuffers() override;
66 68
67 #ifndef NDEBUG 69 #ifndef NDEBUG
68 void VerifyUnitIsKeyFrame(const AccessUnit* unit) const override; 70 void VerifyUnitIsKeyFrame(const AccessUnit* unit) const override;
69 #endif 71 #endif
70 72
71 private: 73 private:
72 // A helper method that releases output buffers and does 74 // A helper method that releases output buffers and does
73 // post-release checks. Might be called by Render() or posted 75 // post-release checks. Might be called by Render() or posted
74 // for later execution. 76 // for later execution.
75 void ReleaseOutputBuffer(int buffer_index, 77 void ReleaseOutputBuffer(int buffer_index,
76 base::TimeDelta pts, 78 base::TimeDelta pts,
77 size_t size,
78 bool render, 79 bool render,
80 bool update_time,
79 bool eos_encountered); 81 bool eos_encountered);
80 82
81 // Data. 83 // Data.
82 84
83 // Configuration received from demuxer 85 // Configuration received from demuxer
84 DemuxerConfigs configs_; 86 DemuxerConfigs configs_;
85 87
86 // Video surface that we render to. 88 // Video surface that we render to.
87 gfx::ScopedJavaSurface surface_; 89 gfx::ScopedJavaSurface surface_;
88 90
(...skipping 18 matching lines...) Expand all
107 109
108 // Mantain the last seen PTS for stand-alone EOS. 110 // Mantain the last seen PTS for stand-alone EOS.
109 base::TimeDelta last_seen_pts_; 111 base::TimeDelta last_seen_pts_;
110 112
111 DISALLOW_COPY_AND_ASSIGN(MediaCodecVideoDecoder); 113 DISALLOW_COPY_AND_ASSIGN(MediaCodecVideoDecoder);
112 }; 114 };
113 115
114 } // namespace media 116 } // namespace media
115 117
116 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_ 118 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698