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

Side by Side Diff: content/common/gpu/media/android_copying_backing_strategy.h

Issue 1882373004: Migrate content/common/gpu/media code to media/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Squash and rebase Created 4 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 CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_
6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11
12 #include "base/compiler_specific.h"
13 #include "content/common/content_export.h"
14 #include "content/common/gpu/media/android_video_decode_accelerator.h"
15
16 namespace gpu {
17 class CopyTextureCHROMIUMResourceManager;
18 }
19
20 namespace media {
21 class PictureBuffer;
22 }
23
24 namespace content {
25
26 class AVDAStateProvider;
27
28 // A BackingStrategy implementation that copies images to PictureBuffer
29 // textures via gpu texture copy.
30 class CONTENT_EXPORT AndroidCopyingBackingStrategy
31 : public AndroidVideoDecodeAccelerator::BackingStrategy {
32 public:
33 explicit AndroidCopyingBackingStrategy(AVDAStateProvider* state_provider);
34 ~AndroidCopyingBackingStrategy() override;
35
36 // AndroidVideoDecodeAccelerator::BackingStrategy
37 gfx::ScopedJavaSurface Initialize(int surface_view_id) override;
38 void Cleanup(
39 bool have_context,
40 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override;
41 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override;
42 uint32_t GetTextureTarget() const override;
43 gfx::Size GetPictureBufferSize() const override;
44 void UseCodecBufferForPictureBuffer(
45 int32_t codec_buffer_index,
46 const media::PictureBuffer& picture_buffer) override;
47 void CodecChanged(media::VideoCodecBridge* codec) override;
48 void OnFrameAvailable() override;
49 bool ArePicturesOverlayable() override;
50 void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer,
51 const gfx::Size& new_size) override;
52
53 private:
54 // Used for copy the texture from surface texture to picture buffers.
55 std::unique_ptr<gpu::CopyTextureCHROMIUMResourceManager> copier_;
56
57 AVDAStateProvider* state_provider_;
58
59 // A container of texture. Used to set a texture to |media_codec_|.
60 scoped_refptr<gfx::SurfaceTexture> surface_texture_;
61
62 // The texture id which is set to |surface_texture_|.
63 uint32_t surface_texture_id_;
64
65 media::VideoCodecBridge* media_codec_;
66 };
67
68 } // namespace content
69
70 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_COPYING_BACKING_STRATEGY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698