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

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

Issue 1128383003: Implementation of MediaCodecPlayer stage 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unused media_codec_player_state.h and .cc Created 5 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_
7
8 #include <set>
9 #include "media/base/android/media_codec_decoder.h"
10 #include "ui/gl/android/scoped_java_surface.h"
11
12 namespace media {
13
14 // Video decoder for MediaCodecPlayer
15 class MediaCodecVideoDecoder : public MediaCodecDecoder {
16 public:
17 MediaCodecVideoDecoder(
18 const scoped_refptr<base::SingleThreadTaskRunner>& media_runner,
19 const scoped_refptr<base::SingleThreadTaskRunner>& ui_runner,
20 const base::Closure& request_data_cb,
21 const base::Closure& starvation_cb,
22 const base::Closure& stop_done_cb,
23 const base::Closure& error_cb,
24 const base::Closure& request_resources_cb);
25 ~MediaCodecVideoDecoder() override;
26
27 const char * class_name() const override { return "VideoDecoder"; }
28
29 bool HasStream() const override;
30 void ReleaseDecoderResources() override;
31
32 // Stores the video surface to use with upcoming Configure()
33 void SetPendingSurface(gfx::ScopedJavaSurface surface);
34
35 // Returns true if there is a video surface to use.
36 bool HasPendingSurface() const;
37
38 // Return the fideo frame dimensions.
39 int GetVideoWidth() const;
40 int GetVideoHeight() const;
41
42 protected:
43 bool IsCodecReconfigureNeeded(const DemuxerConfigs& curr,
44 const DemuxerConfigs& next) const override;
45 ConfigStatus ConfigureInternal() override;
46 void SynchronizePTSWithTime(base::TimeDelta current_time) override;
47 void Render(int buffer_index, size_t size, bool render_output,
48 base::TimeDelta pts, bool eos_encountered) override;
49
50 int NumDelayedRenderTasks() const override;
51 void ReleaseDelayedBuffers() override;
52
53 private:
54 // A helper method that releases output buffers and does
55 // post-release checks. Might be called by Render() or posted
56 // for later execution.
57 void ReleaseOutputBuffer(int buffer_index, bool render,
58 bool eos_encountered);
59
60 // Data.
61
62 // Video surface that we render to.
63 gfx::ScopedJavaSurface surface_;
64
65 // Inform the caller that the MediaCodec is created.
66 base::Closure request_resources_cb_;
67
68 std::set<int> delayed_buffers_;
69
70 // Associate presentation timestamps with time
71 base::TimeTicks start_time_ticks_;
72 base::TimeDelta start_pts_;
73
74 // Mantain last seen PTS for stand-alone EOS
75 base::TimeDelta last_seen_pts_;
76
77 DISALLOW_COPY_AND_ASSIGN(MediaCodecVideoDecoder);
78 };
79
80 } // namespace media
81
82 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698