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

Unified Diff: media/gpu/avda_surface_bundle.h

Issue 2692863011: Add ContentVideoViewOverlay to AVDA. (Closed)
Patch Set: make DequeueOutput require NO_ERROR from setsurface Created 3 years, 9 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: media/gpu/avda_surface_bundle.h
diff --git a/media/gpu/avda_surface_bundle.h b/media/gpu/avda_surface_bundle.h
index 9a8e0ce3ccfb5db08f5b510ff7a92798d530c5fb..a65264c9a491e6e56625ccd16b5bdaaed6f5e85e 100644
--- a/media/gpu/avda_surface_bundle.h
+++ b/media/gpu/avda_surface_bundle.h
@@ -6,6 +6,7 @@
#define MEDIA_GPU_AVDA_SURFACE_BUNDLE_H_
#include "base/memory/ref_counted.h"
+#include "media/base/android/android_overlay.h"
#include "media/base/surface_manager.h"
#include "ui/gl/android/scoped_java_surface.h"
#include "ui/gl/android/surface_texture.h"
@@ -27,15 +28,36 @@ class AVDASurfaceBundle : public base::RefCountedThreadSafe<AVDASurfaceBundle> {
public:
explicit AVDASurfaceBundle(int surface_id);
+ // The surface that MediaCodec is configured to output to. This can be either
+ // a SurfaceTexture or other Surface provider.
+ // TODO(liberato): it would be nice if we had an abstraction that included
+ // SurfaceTexture and Overlay, but we don't right now.
+ const base::android::JavaRef<jobject>& j_surface() const {
+ if (overlay)
+ return overlay->GetJavaSurface();
+ else
+ return surface_texture_surface.j_surface();
+ }
+
int surface_id = SurfaceManager::kNoSurfaceID;
// The surface onto which the codec is writing.
- gl::ScopedJavaSurface surface;
+ // TODO(liberato): this isn't true if we have an overlay. the overlay keeps
+ // the java surface.
+ // gl::ScopedJavaSurface surface;
+
+ // If |overlay| is non-null, then |overlay| owns |surface|.
+ std::unique_ptr<AndroidOverlay> overlay;
// The SurfaceTexture attached to |surface|, or nullptr if |surface| is
// SurfaceView backed.
scoped_refptr<gl::SurfaceTexture> surface_texture;
+ // If |surface_texture| is not null, then this is the surface for it.
+ // TODO(liberato): |surface| is the same thing, since overlays own their own
+ // surfaces anyway.
+ gl::ScopedJavaSurface surface_texture_surface;
+
private:
~AVDASurfaceBundle();
friend class base::RefCountedThreadSafe<AVDASurfaceBundle>;

Powered by Google App Engine
This is Rietveld 408576698