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

Unified Diff: content/common/gpu/media/avda_shared_state.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, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/avda_shared_state.h
diff --git a/content/common/gpu/media/avda_shared_state.h b/content/common/gpu/media/avda_shared_state.h
deleted file mode 100644
index 79534f2cf30eae4e4549a63f2f48ba6462eaa364..0000000000000000000000000000000000000000
--- a/content/common/gpu/media/avda_shared_state.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// 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 CONTENT_COMMON_GPU_AVDA_SHARED_STATE_H_
-#define CONTENT_COMMON_GPU_AVDA_SHARED_STATE_H_
-
-#include "base/synchronization/waitable_event.h"
-#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
-#include "media/base/android/media_codec_bridge.h"
-#include "media/base/android/sdk_media_codec_bridge.h"
-#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_image.h"
-#include "ui/gl/gl_surface.h"
-
-namespace gfx {
-class SurfaceTexture;
-}
-
-namespace media {
-class MediaCodecBridge;
-}
-
-namespace content {
-class AVDACodecImage;
-
-// Shared state to allow communication between the AVDA and the
-// GLImages that configure GL for drawing the frames.
-class AVDASharedState : public base::RefCounted<AVDASharedState> {
- public:
- AVDASharedState();
-
- GLint surface_texture_service_id() const {
- return surface_texture_service_id_;
- }
-
- // Set the SurfaceTexture's client texture name, which the SurfaceTexture
- // might not know about yet (see surface_texture_is_attached()).
- void set_surface_texture_service_id(GLint id) {
- surface_texture_service_id_ = id;
- }
-
- // Signal the "frame available" event. This may be called from any thread.
- void SignalFrameAvailable();
-
- void WaitForFrameAvailable();
-
- // Context that the surface texture is bound to, or nullptr if it is not in
- // the attached state.
- gfx::GLContext* context() const { return context_.get(); }
-
- gfx::GLSurface* surface() const { return surface_.get(); }
-
- bool surface_texture_is_attached() const {
- return surface_texture_is_attached_;
- }
-
- // Iterates over all known codec images and updates the MediaCodec attached to
- // each one.
- void CodecChanged(media::MediaCodecBridge* codec);
-
- // Methods for finding and updating the AVDACodecImage associated with a given
- // picture buffer id. GetImageForPicture() will return null for unknown ids.
- // Calling SetImageForPicture() with a nullptr will erase the entry.
- void SetImageForPicture(int picture_buffer_id, AVDACodecImage* image);
- AVDACodecImage* GetImageForPicture(int picture_buffer_id) const;
-
- // TODO(liberato): move the surface texture here and make these calls
- // attach / detach it also. There are several changes going on in avda
- // concurrently, so I don't want to change that until the dust settles.
- // AVDACodecImage would no longer hold the surface texture.
-
- // Call this when the SurfaceTexture is attached to a GL context. This will
- // update surface_texture_is_attached(), and set the context() and surface()
- // to match.
- void DidAttachSurfaceTexture();
-
- // Call this when the SurfaceTexture is detached from its GL context. This
- // will cause us to forget the last binding.
- void DidDetachSurfaceTexture();
-
- protected:
- virtual ~AVDASharedState();
-
- private:
- friend class base::RefCounted<AVDASharedState>;
-
- // Platform gl texture Id for |surface_texture_|. This will be zero if
- // and only if |texture_owner_| is null.
- // TODO(liberato): This should be GLuint, but we don't seem to have the type.
- GLint surface_texture_service_id_;
-
- // For signalling OnFrameAvailable().
- base::WaitableEvent frame_available_event_;
-
- // True if and only if the surface texture is currently attached.
- bool surface_texture_is_attached_;
-
- // Context and surface that the surface texture is attached to, if it is
- // currently attached.
- scoped_refptr<gfx::GLContext> context_;
- scoped_refptr<gfx::GLSurface> surface_;
-
- // Maps a picture buffer id to a AVDACodecImage.
- std::map<int, AVDACodecImage*> codec_images_;
-
- DISALLOW_COPY_AND_ASSIGN(AVDASharedState);
-};
-
-} // namespace content
-
-#endif // CONTENT_COMMON_GPU_AVDA_SHARED_STATE_H_

Powered by Google App Engine
This is Rietveld 408576698