| Index: media/base/android/media_codec_video_decoder.h
|
| diff --git a/media/base/android/media_codec_video_decoder.h b/media/base/android/media_codec_video_decoder.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c67776efbcc2051f3118ac6634cf69396771421f
|
| --- /dev/null
|
| +++ b/media/base/android/media_codec_video_decoder.h
|
| @@ -0,0 +1,67 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_
|
| +#define MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_
|
| +
|
| +#include <set>
|
| +#include "media/base/android/media_codec_decoder.h"
|
| +#include "ui/gl/android/scoped_java_surface.h"
|
| +
|
| +namespace media {
|
| +
|
| +class MediaCodecVideoDecoder : public MediaCodecDecoder {
|
| + public:
|
| + MediaCodecVideoDecoder(
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& media_runner,
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& ui_runner,
|
| + const base::Closure& request_data_cb,
|
| + const base::Closure& starvation_cb,
|
| + const base::Closure& stop_done_cb,
|
| + const base::Closure& error_cb,
|
| + const SetTimeCallback& update_current_time_cb,
|
| + const base::Closure& request_resources_cb);
|
| + ~MediaCodecVideoDecoder() override;
|
| +
|
| + const char * class_name() const override { return "VideoDecoder"; }
|
| +
|
| + bool HasStream() const override;
|
| + void ReleaseDecoderResources() override;
|
| +
|
| + void SetPendingSurface(gfx::ScopedJavaSurface surface);
|
| + bool HasPendingSurface() const;
|
| +
|
| + int GetVideoWidth() const;
|
| + int GetVideoHeight() const;
|
| +
|
| + protected:
|
| + bool IsCodecReconfigureNeeded(const DemuxerConfigs& curr,
|
| + const DemuxerConfigs& next) const override;
|
| + ConfigStatus ConfigureInternal() override;
|
| + void Render(int buffer_index, size_t size, bool render_output,
|
| + base::TimeDelta pts, bool eos_encountered) override;
|
| +
|
| + int NumDelayedRenderTasks() const override;
|
| + void ReleaseDelayedBuffers() override;
|
| +
|
| + private:
|
| + void ReleaseOutputBuffer(int buffer_index, bool render,
|
| + bool eos_encountered);
|
| +
|
| + // Data.
|
| +
|
| + // Video surface that we render to.
|
| + gfx::ScopedJavaSurface surface_;
|
| +
|
| + // Inform the caller that the MediaCodec is created.
|
| + base::Closure request_resources_cb_;
|
| +
|
| + std::set<int> delayed_buffers_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MediaCodecVideoDecoder);
|
| +};
|
| +
|
| +} // namespace media
|
| +
|
| +#endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_VIDEO_DECODER_H_
|
|
|