Merge branch 'eclair' into eclair-release
This commit is contained in:
@@ -14970,6 +14970,71 @@
|
||||
>
|
||||
</method>
|
||||
</interface>
|
||||
<class name="AccountManagerResponse"
|
||||
extends="java.lang.Object"
|
||||
abstract="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<implements name="android.os.Parcelable">
|
||||
</implements>
|
||||
<method name="describeContents"
|
||||
return="int"
|
||||
abstract="false"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</method>
|
||||
<method name="onError"
|
||||
return="void"
|
||||
abstract="false"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="errorCode" type="int">
|
||||
</parameter>
|
||||
<parameter name="errorMessage" type="java.lang.String">
|
||||
</parameter>
|
||||
</method>
|
||||
<method name="onResult"
|
||||
return="void"
|
||||
abstract="false"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="result" type="android.os.Bundle">
|
||||
</parameter>
|
||||
</method>
|
||||
<method name="writeToParcel"
|
||||
return="void"
|
||||
abstract="false"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="dest" type="android.os.Parcel">
|
||||
</parameter>
|
||||
<parameter name="flags" type="int">
|
||||
</parameter>
|
||||
</method>
|
||||
</class>
|
||||
<class name="AccountsException"
|
||||
extends="java.lang.Exception"
|
||||
abstract="false"
|
||||
|
||||
@@ -22,16 +22,17 @@ import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/**
|
||||
* Object that wraps calls to an {@link android.accounts.IAccountManagerResponse} object.
|
||||
* @hide
|
||||
* Used by Account Authenticators to return a response.
|
||||
*/
|
||||
public class AccountManagerResponse implements Parcelable {
|
||||
private IAccountManagerResponse mResponse;
|
||||
|
||||
/** @hide */
|
||||
public AccountManagerResponse(IAccountManagerResponse response) {
|
||||
mResponse = response;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public AccountManagerResponse(Parcel parcel) {
|
||||
mResponse =
|
||||
IAccountManagerResponse.Stub.asInterface(parcel.readStrongBinder());
|
||||
@@ -53,14 +54,17 @@ public class AccountManagerResponse implements Parcelable {
|
||||
}
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeStrongBinder(mResponse.asBinder());
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Creator<AccountManagerResponse> CREATOR =
|
||||
new Creator<AccountManagerResponse>() {
|
||||
public AccountManagerResponse createFromParcel(Parcel source) {
|
||||
@@ -71,4 +75,4 @@ public class AccountManagerResponse implements Parcelable {
|
||||
return new AccountManagerResponse[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,8 +545,12 @@ public class ContentProviderOperation implements Parcelable {
|
||||
"only updates, deletes, and asserts can have selections");
|
||||
}
|
||||
mSelection = selection;
|
||||
mSelectionArgs = new String[selectionArgs.length];
|
||||
System.arraycopy(selectionArgs, 0, mSelectionArgs, 0, selectionArgs.length);
|
||||
if (selectionArgs == null) {
|
||||
mSelectionArgs = null;
|
||||
} else {
|
||||
mSelectionArgs = new String[selectionArgs.length];
|
||||
System.arraycopy(selectionArgs, 0, mSelectionArgs, 0, selectionArgs.length);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,10 @@ MediaPlayerService::~MediaPlayerService()
|
||||
sp<IMediaRecorder> MediaPlayerService::createMediaRecorder(pid_t pid)
|
||||
{
|
||||
#ifndef NO_OPENCORE
|
||||
sp<MediaRecorderClient> recorder = new MediaRecorderClient(pid);
|
||||
sp<MediaRecorderClient> recorder = new MediaRecorderClient(this, pid);
|
||||
wp<MediaRecorderClient> w = recorder;
|
||||
Mutex::Autolock lock(mLock);
|
||||
mMediaRecorderClients.add(w);
|
||||
#else
|
||||
sp<MediaRecorderClient> recorder = NULL;
|
||||
#endif
|
||||
@@ -233,6 +236,13 @@ sp<IMediaRecorder> MediaPlayerService::createMediaRecorder(pid_t pid)
|
||||
return recorder;
|
||||
}
|
||||
|
||||
void MediaPlayerService::removeMediaRecorderClient(wp<MediaRecorderClient> client)
|
||||
{
|
||||
Mutex::Autolock lock(mLock);
|
||||
mMediaRecorderClients.remove(client);
|
||||
LOGV("Delete media recorder client");
|
||||
}
|
||||
|
||||
sp<IMediaMetadataRetriever> MediaPlayerService::createMetadataRetriever(pid_t pid)
|
||||
{
|
||||
sp<MetadataRetrieverClient> retriever = new MetadataRetrieverClient(pid);
|
||||
@@ -460,6 +470,13 @@ status_t MediaPlayerService::dump(int fd, const Vector<String16>& args)
|
||||
sp<Client> c = mClients[i].promote();
|
||||
if (c != 0) c->dump(fd, args);
|
||||
}
|
||||
for (int i = 0, n = mMediaRecorderClients.size(); i < n; ++i) {
|
||||
result.append(" MediaRecorderClient\n");
|
||||
sp<MediaRecorderClient> c = mMediaRecorderClients[i].promote();
|
||||
snprintf(buffer, 255, " pid(%d)\n\n", c->mPid);
|
||||
result.append(buffer);
|
||||
}
|
||||
|
||||
result.append(" Files opened and/or mapped:\n");
|
||||
snprintf(buffer, SIZE, "/proc/%d/maps", myTid());
|
||||
FILE *f = fopen(buffer, "r");
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace android {
|
||||
class IMediaRecorder;
|
||||
class IMediaMetadataRetriever;
|
||||
class IOMX;
|
||||
class MediaRecorderClient;
|
||||
|
||||
#define CALLBACK_ANTAGONIZER 0
|
||||
#if CALLBACK_ANTAGONIZER
|
||||
@@ -175,6 +176,7 @@ public:
|
||||
|
||||
// IMediaPlayerService interface
|
||||
virtual sp<IMediaRecorder> createMediaRecorder(pid_t pid);
|
||||
void removeMediaRecorderClient(wp<MediaRecorderClient> client);
|
||||
virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t pid);
|
||||
|
||||
// House keeping for media player clients
|
||||
@@ -280,6 +282,7 @@ private:
|
||||
|
||||
mutable Mutex mLock;
|
||||
SortedVector< wp<Client> > mClients;
|
||||
SortedVector< wp<MediaRecorderClient> > mMediaRecorderClients;
|
||||
int32_t mNextConnId;
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,10 @@
|
||||
#include <media/PVMediaRecorder.h>
|
||||
#include <utils/String16.h>
|
||||
|
||||
#include <media/AudioTrack.h>
|
||||
|
||||
#include "MediaRecorderClient.h"
|
||||
#include "MediaPlayerService.h"
|
||||
|
||||
namespace android {
|
||||
|
||||
@@ -80,6 +83,7 @@ status_t MediaRecorderClient::setVideoSource(int vs)
|
||||
Mutex::Autolock lock(mLock);
|
||||
if (mRecorder == NULL) {
|
||||
LOGE("recorder is not initialized");
|
||||
return NO_INIT;
|
||||
}
|
||||
return mRecorder->setVideoSource((video_source)vs);
|
||||
}
|
||||
@@ -93,6 +97,7 @@ status_t MediaRecorderClient::setAudioSource(int as)
|
||||
Mutex::Autolock lock(mLock);
|
||||
if (mRecorder == NULL) {
|
||||
LOGE("recorder is not initialized");
|
||||
return NO_INIT;
|
||||
}
|
||||
return mRecorder->setAudioSource((audio_source)as);
|
||||
}
|
||||
@@ -271,15 +276,18 @@ status_t MediaRecorderClient::release()
|
||||
if (mRecorder != NULL) {
|
||||
delete mRecorder;
|
||||
mRecorder = NULL;
|
||||
wp<MediaRecorderClient> client(this);
|
||||
mMediaPlayerService->removeMediaRecorderClient(client);
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
MediaRecorderClient::MediaRecorderClient(pid_t pid)
|
||||
MediaRecorderClient::MediaRecorderClient(const sp<MediaPlayerService>& service, pid_t pid)
|
||||
{
|
||||
LOGV("Client constructor");
|
||||
mPid = pid;
|
||||
mRecorder = new PVMediaRecorder();
|
||||
mMediaPlayerService = service;
|
||||
}
|
||||
|
||||
MediaRecorderClient::~MediaRecorderClient()
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace android {
|
||||
|
||||
class PVMediaRecorder;
|
||||
class ISurface;
|
||||
class MediaPlayerService;
|
||||
|
||||
class MediaRecorderClient : public BnMediaRecorder
|
||||
{
|
||||
@@ -53,12 +54,13 @@ public:
|
||||
private:
|
||||
friend class MediaPlayerService; // for accessing private constructor
|
||||
|
||||
MediaRecorderClient(pid_t pid);
|
||||
MediaRecorderClient(const sp<MediaPlayerService>& service, pid_t pid);
|
||||
virtual ~MediaRecorderClient();
|
||||
|
||||
pid_t mPid;
|
||||
Mutex mLock;
|
||||
PVMediaRecorder *mRecorder;
|
||||
sp<MediaPlayerService> mMediaPlayerService;
|
||||
};
|
||||
|
||||
}; // namespace android
|
||||
|
||||
@@ -68,31 +68,28 @@ int main(int argc, char** argv)
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glDisable(GL_DITHER);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glColor4f(1,1,1,1);
|
||||
|
||||
const uint32_t t32[] = {
|
||||
0xFFFFFFFF, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000,
|
||||
0xFFFFFF00, 0xFFFF00FF, 0xFF00FFFF, 0xFF000000
|
||||
};
|
||||
const uint16_t t16[64] = { 0xFFFF, 0xF800, 0x07E0, 0x001F };
|
||||
|
||||
const GLfloat vertices[4][2] = {
|
||||
{ 0, 0 },
|
||||
{ w, h }
|
||||
{ w/2, 0 },
|
||||
{ w/2, h }
|
||||
};
|
||||
|
||||
const GLfloat texCoords[4][2] = {
|
||||
{ 0, 0 },
|
||||
{ 1, 0 }
|
||||
{ 1, 1 }
|
||||
};
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 8, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, t32);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 4, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, t16);
|
||||
|
||||
glViewport(0, 0, w, h);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
|
||||
Reference in New Issue
Block a user