2012-01-31 06:40:58 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2012-01-31 06:40:58 -08:00
|
|
|
|
|
|
|
#ifndef AndroidMediaLayer_h_
|
|
|
|
#define AndroidMediaLayer_h_
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <jni.h>
|
|
|
|
#include "gfxRect.h"
|
2012-02-15 12:34:31 -08:00
|
|
|
#include "nsISupports.h"
|
2012-01-31 06:40:58 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class AndroidMediaLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AndroidMediaLayer();
|
|
|
|
virtual ~AndroidMediaLayer();
|
2012-02-15 12:34:31 -08:00
|
|
|
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(AndroidMediaLayer)
|
2012-01-31 06:40:58 -08:00
|
|
|
|
|
|
|
void* GetNativeWindowForContent();
|
|
|
|
|
|
|
|
void* RequestNativeWindowForVideo();
|
|
|
|
void ReleaseNativeWindowForVideo(void* aWindow);
|
|
|
|
|
|
|
|
void SetNativeWindowDimensions(void* aWindow, const gfxRect& aDimensions);
|
|
|
|
|
2012-04-27 13:04:47 -07:00
|
|
|
void UpdatePosition(const gfxRect& aRect);
|
2012-01-31 06:40:58 -08:00
|
|
|
|
|
|
|
bool Inverted() {
|
|
|
|
return mInverted;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetInverted(bool aInverted) {
|
|
|
|
mInverted = aInverted;
|
|
|
|
}
|
|
|
|
|
2012-02-15 12:34:31 -08:00
|
|
|
bool IsVisible() {
|
|
|
|
return mVisible;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetVisible(bool aVisible);
|
|
|
|
|
2012-01-31 06:40:58 -08:00
|
|
|
private:
|
|
|
|
bool mInverted;
|
2012-02-15 12:34:31 -08:00
|
|
|
bool mVisible;
|
2012-01-31 06:40:58 -08:00
|
|
|
|
|
|
|
class SurfaceData {
|
|
|
|
public:
|
|
|
|
SurfaceData() :
|
|
|
|
surface(NULL), window(NULL) {
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceData(jobject aSurface, void* aWindow) :
|
|
|
|
surface(aSurface), window(aWindow) {
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject surface;
|
|
|
|
void* window;
|
|
|
|
gfxRect dimensions;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool EnsureContentSurface();
|
|
|
|
|
|
|
|
SurfaceData mContentData;
|
|
|
|
std::map<void*, SurfaceData*> mVideoSurfaces;
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* mozilla */
|
|
|
|
#endif /* AndroidMediaLayer_h_ */
|