blob: d2685f84a327c86baae4a0843b1463f6f3d956e9 [file] [log] [blame]
// Copyright (c) 2012 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_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_
#define CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_
#include "base/android/scoped_java_ref.h"
#include "base/compiler_specific.h"
#include "content/common/android/surface_texture_peer.h"
namespace content {
// The SurfaceTexturePeer implementation for browser process.
class SurfaceTexturePeerBrowserImpl : public SurfaceTexturePeer {
public:
// Construct a SurfaceTexturePeerBrowserImpl object. If
// |player_in_render_process| is true, calling EstablishSurfaceTexturePeer()
// will send the java surface texture object to the render process through
// SandboxedProcessService. Otherwise, it will pass the surface texture
// to the MediaPlayerBridge object in the browser process.
explicit SurfaceTexturePeerBrowserImpl(bool player_in_render_process);
virtual ~SurfaceTexturePeerBrowserImpl();
// SurfaceTexturePeer implementation.
virtual void EstablishSurfaceTexturePeer(
base::ProcessHandle render_process_handle,
SurfaceTextureTarget type,
jobject j_surface_texture,
int render_view_id,
int player_id) OVERRIDE;
static bool RegisterBrowserProcessSurfaceTexture(JNIEnv* env);
private:
// Whether the media player is in render process.
bool player_in_render_process_;
base::android::ScopedJavaGlobalRef<jobject> surface_;
DISALLOW_COPY_AND_ASSIGN(SurfaceTexturePeerBrowserImpl);
};
} // namespace content
#endif // CONTENT_BROWSER_ANDROID_SURFACE_TEXTURE_PEER_BROWSER_IMPL_H_