OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIDEO_DECODER_JOB_H_ | 5 #ifndef MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ |
6 #define MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ | 6 #define MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "media/base/android/media_decoder_job.h" | 10 #include "media/base/android/media_decoder_job.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 const base::Closure& request_resources_cb, | 26 const base::Closure& request_resources_cb, |
27 const base::Closure& on_demuxer_config_changed_cb); | 27 const base::Closure& on_demuxer_config_changed_cb); |
28 virtual ~VideoDecoderJob(); | 28 virtual ~VideoDecoderJob(); |
29 | 29 |
30 // Passes a java surface object to the codec. Returns true if the surface | 30 // Passes a java surface object to the codec. Returns true if the surface |
31 // can be used by the decoder, or false otherwise. | 31 // can be used by the decoder, or false otherwise. |
32 bool SetVideoSurface(gfx::ScopedJavaSurface surface); | 32 bool SetVideoSurface(gfx::ScopedJavaSurface surface); |
33 | 33 |
34 // MediaDecoderJob implementation. | 34 // MediaDecoderJob implementation. |
35 virtual bool HasStream() const override; | 35 virtual bool HasStream() const override; |
36 virtual void Flush() override; | |
37 virtual void ReleaseDecoderResources() override; | 36 virtual void ReleaseDecoderResources() override; |
38 virtual void SetDemuxerConfigs(const DemuxerConfigs& configs) override; | 37 virtual void SetDemuxerConfigs(const DemuxerConfigs& configs) override; |
39 | 38 |
40 bool next_video_data_is_iframe() { | |
41 return next_video_data_is_iframe_; | |
42 } | |
43 | |
44 int output_width() const { return output_width_; } | 39 int output_width() const { return output_width_; } |
45 int output_height() const { return output_height_; } | 40 int output_height() const { return output_height_; } |
46 | 41 |
47 private: | 42 private: |
48 // MediaDecoderJob implementation. | 43 // MediaDecoderJob implementation. |
49 virtual void ReleaseOutputBuffer( | 44 virtual void ReleaseOutputBuffer( |
50 int output_buffer_index, | 45 int output_buffer_index, |
51 size_t size, | 46 size_t size, |
52 bool render_output, | 47 bool render_output, |
53 base::TimeDelta current_presentation_timestamp, | 48 base::TimeDelta current_presentation_timestamp, |
54 const ReleaseOutputCompletionCallback& callback) override; | 49 const ReleaseOutputCompletionCallback& callback) override; |
55 virtual bool ComputeTimeToRender() const override; | 50 virtual bool ComputeTimeToRender() const override; |
56 virtual bool IsCodecReconfigureNeeded( | 51 virtual bool IsCodecReconfigureNeeded( |
57 const DemuxerConfigs& configs) const override; | 52 const DemuxerConfigs& configs) const override; |
58 virtual bool AreDemuxerConfigsChanged( | 53 virtual bool AreDemuxerConfigsChanged( |
59 const DemuxerConfigs& configs) const override; | 54 const DemuxerConfigs& configs) const override; |
60 virtual bool CreateMediaCodecBridgeInternal() override; | 55 virtual MediaDecoderJobStatus CreateMediaCodecBridgeInternal() override; |
61 virtual void CurrentDataConsumed(bool is_config_change) override; | |
62 virtual bool UpdateOutputFormat() override; | 56 virtual bool UpdateOutputFormat() override; |
63 | 57 |
64 // Returns true if a protected surface is required for video playback. | 58 // Returns true if a protected surface is required for video playback. |
65 bool IsProtectedSurfaceRequired(); | 59 bool IsProtectedSurfaceRequired(); |
66 | 60 |
67 // Video configs from the demuxer. | 61 // Video configs from the demuxer. |
68 VideoCodec video_codec_; | 62 VideoCodec video_codec_; |
69 int config_width_; | 63 int config_width_; |
70 int config_height_; | 64 int config_height_; |
71 | 65 |
72 // Video output format. | 66 // Video output format. |
73 int output_width_; | 67 int output_width_; |
74 int output_height_; | 68 int output_height_; |
75 | 69 |
76 // The surface object currently owned by the player. | 70 // The surface object currently owned by the player. |
77 gfx::ScopedJavaSurface surface_; | 71 gfx::ScopedJavaSurface surface_; |
78 | 72 |
79 // Callbacks to inform the caller about decoder resources change. | 73 // Callbacks to inform the caller about decoder resources change. |
80 base::Closure request_resources_cb_; | 74 base::Closure request_resources_cb_; |
81 base::Closure release_resources_cb_; | 75 base::Closure release_resources_cb_; |
82 | 76 |
83 // Track whether the next access unit is an I-frame. The first access | |
84 // unit after Flush() and CurrentDataConsumed(true) is guaranteed to be an | |
85 // I-frame. | |
86 bool next_video_data_is_iframe_; | |
87 | |
88 DISALLOW_COPY_AND_ASSIGN(VideoDecoderJob); | 77 DISALLOW_COPY_AND_ASSIGN(VideoDecoderJob); |
89 }; | 78 }; |
90 | 79 |
91 } // namespace media | 80 } // namespace media |
92 | 81 |
93 #endif // MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ | 82 #endif // MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ |
OLD | NEW |