本文整理汇总了C++中Parcel::readString8方法的典型用法代码示例。如果您正苦于以下问题:C++ Parcel::readString8方法的具体用法?C++ Parcel::readString8怎么用?C++ Parcel::readString8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parcel
的用法示例。
在下文中一共展示了Parcel::readString8方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTransact
status_t BnDrmIOService::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) {
switch (code) {
case WRITE_TO_FILE:
{
CHECK_INTERFACE(IDrmIOService, data, reply);
writeToFile(data.readString8(), data.readString8());
return DRM_NO_ERROR;
}
case READ_FROM_FILE:
{
CHECK_INTERFACE(IDrmIOService, data, reply);
String8 dataBuffer = readFromFile(data.readString8());
reply->writeString8(dataBuffer);
return DRM_NO_ERROR;
}
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
示例2: onTransact
status_t BnSurfaceComposerClient::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case CREATE_SURFACE: {
CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
surface_data_t params;
String8 name = data.readString8();
DisplayID display = data.readInt32();
uint32_t w = data.readInt32();
uint32_t h = data.readInt32();
PixelFormat format = data.readInt32();
uint32_t flags = data.readInt32();
sp<ISurface> s = createSurface(¶ms, name, display, w, h,
format, flags);
params.writeToParcel(reply);
reply->writeStrongBinder(s->asBinder());
return NO_ERROR;
} break;
case DESTROY_SURFACE: {
CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
reply->writeInt32( destroySurface( data.readInt32() ) );
return NO_ERROR;
} break;
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
示例3: onTransact
status_t BnAudioPolicyServiceClient::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch (code) {
case PORT_LIST_UPDATE: {
CHECK_INTERFACE(IAudioPolicyServiceClient, data, reply);
onAudioPortListUpdate();
return NO_ERROR;
} break;
case PATCH_LIST_UPDATE: {
CHECK_INTERFACE(IAudioPolicyServiceClient, data, reply);
onAudioPatchListUpdate();
return NO_ERROR;
} break;
case MIX_STATE_UPDATE: {
CHECK_INTERFACE(IAudioPolicyServiceClient, data, reply);
String8 regId = data.readString8();
int32_t state = data.readInt32();
onDynamicPolicyMixStateUpdate(regId, state);
return NO_ERROR;
}
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
示例4: android_view_InputChannel_nativeReadFromParcel
static void android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject obj,
jobject parcelObj) {
if (android_view_InputChannel_getNativeInputChannel(env, obj) != NULL) {
jniThrowException(env, "java/lang/IllegalStateException",
"This object already has a native input channel.");
return;
}
Parcel* parcel = parcelForJavaObject(env, parcelObj);
if (parcel) {
bool isInitialized = parcel->readInt32();
if (isInitialized) {
String8 name = parcel->readString8();
int rawFd = parcel->readFileDescriptor();
int dupFd = dup(rawFd);
if (dupFd < 0) {
ALOGE("Error %d dup channel fd %d.", errno, rawFd);
jniThrowRuntimeException(env,
"Could not read input channel file descriptors from parcel.");
return;
}
InputChannel* inputChannel = new InputChannel(name.string(), dupFd);
NativeInputChannel* nativeInputChannel = new NativeInputChannel(inputChannel);
android_view_InputChannel_setNativeInputChannel(env, obj, nativeInputChannel);
}
}
}
示例5: onTransact
status_t BnSensorServer::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case GET_SENSOR_LIST: {
CHECK_INTERFACE(ISensorServer, data, reply);
const String16& opPackageName = data.readString16();
Vector<Sensor> v(getSensorList(opPackageName));
size_t n = v.size();
reply->writeUint32(static_cast<uint32_t>(n));
for (size_t i = 0; i < n; i++) {
reply->write(v[i]);
}
return NO_ERROR;
}
case CREATE_SENSOR_EVENT_CONNECTION: {
CHECK_INTERFACE(ISensorServer, data, reply);
String8 packageName = data.readString8();
int32_t mode = data.readInt32();
const String16& opPackageName = data.readString16();
sp<ISensorEventConnection> connection(createSensorEventConnection(packageName, mode,
opPackageName));
reply->writeStrongBinder(IInterface::asBinder(connection));
return NO_ERROR;
}
case ENABLE_DATA_INJECTION: {
CHECK_INTERFACE(ISensorServer, data, reply);
int32_t ret = isDataInjectionEnabled();
reply->writeInt32(static_cast<int32_t>(ret));
return NO_ERROR;
}
}
return BBinder::onTransact(code, data, reply, flags);
}
示例6: onTransact
status_t CameraService::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) {
// Permission checks
switch (code) {
//!++
#ifdef MTK_CAMERA_BSP_SUPPORT
case BnCameraService::GET_PROPERTY:
{
CHECK_INTERFACE(ICameraService, data, reply);
String8 const key = data.readString8();
String8 value;
status_t const status = getProperty(key, value);
reply->writeString8(value);
reply->writeInt32(status);
ALOGD("[GET_PROPERTY] - pid=%d, uid=%d (%s)=(%s) \n", getCallingPid(), getCallingUid(), key.string(), value.string());
return OK;
}
case BnCameraService::SET_PROPERTY:
{
CHECK_INTERFACE(ICameraService, data, reply);
String8 const key = data.readString8();
String8 const value = data.readString8();
status_t const status = setProperty(key, value);
reply->writeInt32(status);
ALOGD("[SET_PROPERTY] - pid=%d, uid=%d (%s)=(%s) \n", getCallingPid(), getCallingUid(), key.string(), value.string());
return OK;
}
#endif //MTK_CAMERA_BSP_SUPPORT
//!--
case BnCameraService::CONNECT:
const int pid = getCallingPid();
const int self_pid = getpid();
if (pid != self_pid) {
// we're called from a different process, do the real check
if (!checkCallingPermission(
String16("android.permission.CAMERA"))) {
const int uid = getCallingUid();
ALOGE("Permission Denial: "
"can't use the camera pid=%d, uid=%d", pid, uid);
return PERMISSION_DENIED;
}
}
break;
}
return BnCameraService::onTransact(code, data, reply, flags);
}
示例7: onTransact
status_t BnPrivateAfGlueHandler::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch (code) {
case HANDLE_SET_PARAMETERS: {
CHECK_INTERFACE(IPrivateAfGlueHandler, data, reply);
audio_io_handle_t ioHandle = (audio_io_handle_t) data.readInt32();
String8 keyValuePairs(data.readString8());
reply->writeInt32(handleSetParameters(ioHandle, keyValuePairs));
return NO_ERROR;
} break;
case HANDLE_GET_PARAMETERS: {
CHECK_INTERFACE(IPrivateAfGlueHandler, data, reply);
audio_io_handle_t ioHandle = (audio_io_handle_t) data.readInt32();
String8 keys(data.readString8());
reply->writeString8(handleGetParameters(ioHandle, keys));
return NO_ERROR;
} break;
default:
return BBinder::onTransact(code, data, reply, flags);
}
};
示例8: onTransact
status_t BnSurfaceComposerClient::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case CREATE_SURFACE: {
CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
String8 name = data.readString8();
uint32_t w = data.readInt32();
uint32_t h = data.readInt32();
PixelFormat format = data.readInt32();
uint32_t flags = data.readInt32();
sp<IBinder> handle;
sp<IGraphicBufferProducer> gbp;
status_t result = createSurface(name, w, h, format, flags,
&handle, &gbp);
reply->writeStrongBinder(handle);
reply->writeStrongBinder(gbp->asBinder());
reply->writeInt32(result);
return NO_ERROR;
} break;
case DESTROY_SURFACE: {
CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
reply->writeInt32(destroySurface( data.readStrongBinder() ) );
return NO_ERROR;
} break;
case CLEAR_LAYER_FRAME_STATS: {
CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
sp<IBinder> handle = data.readStrongBinder();
status_t result = clearLayerFrameStats(handle);
reply->writeInt32(result);
return NO_ERROR;
} break;
case GET_LAYER_FRAME_STATS: {
CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
sp<IBinder> handle = data.readStrongBinder();
FrameStats stats;
status_t result = getLayerFrameStats(handle, &stats);
reply->write(stats);
reply->writeInt32(result);
return NO_ERROR;
} break;
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
示例9: android_view_InputChannel_nativeReadFromParcel
static void android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject obj,
jobject parcelObj) {
if (android_view_InputChannel_getNativeInputChannel(env, obj) != NULL) {
jniThrowException(env, "java/lang/IllegalStateException",
"This object already has a native input channel.");
return;
}
Parcel* parcel = parcelForJavaObject(env, parcelObj);
if (parcel) {
bool isInitialized = parcel->readInt32();
if (isInitialized) {
String8 name = parcel->readString8();
int32_t parcelAshmemFd = parcel->readFileDescriptor();
int32_t ashmemFd = dup(parcelAshmemFd);
if (ashmemFd < 0) {
ALOGE("Error %d dup ashmem fd %d.", errno, parcelAshmemFd);
}
int32_t parcelReceivePipeFd = parcel->readFileDescriptor();
int32_t receivePipeFd = dup(parcelReceivePipeFd);
if (receivePipeFd < 0) {
ALOGE("Error %d dup receive pipe fd %d.", errno, parcelReceivePipeFd);
}
int32_t parcelSendPipeFd = parcel->readFileDescriptor();
int32_t sendPipeFd = dup(parcelSendPipeFd);
if (sendPipeFd < 0) {
ALOGE("Error %d dup send pipe fd %d.", errno, parcelSendPipeFd);
}
if (ashmemFd < 0 || receivePipeFd < 0 || sendPipeFd < 0) {
if (ashmemFd >= 0) ::close(ashmemFd);
if (receivePipeFd >= 0) ::close(receivePipeFd);
if (sendPipeFd >= 0) ::close(sendPipeFd);
jniThrowRuntimeException(env,
"Could not read input channel file descriptors from parcel.");
return;
}
InputChannel* inputChannel = new InputChannel(name, ashmemFd,
receivePipeFd, sendPipeFd);
NativeInputChannel* nativeInputChannel = new NativeInputChannel(inputChannel);
android_view_InputChannel_setNativeInputChannel(env, obj, nativeInputChannel);
}
}
}
示例10: onTransact
status_t BnCameraRecordingProxy::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case START_RECORDING: {
ALOGV("START_RECORDING");
CHECK_INTERFACE(ICameraRecordingProxy, data, reply);
sp<ICameraRecordingProxyListener> listener =
interface_cast<ICameraRecordingProxyListener>(data.readStrongBinder());
reply->writeInt32(startRecording(listener));
return NO_ERROR;
} break;
case STOP_RECORDING: {
ALOGV("STOP_RECORDING");
CHECK_INTERFACE(ICameraRecordingProxy, data, reply);
stopRecording();
return NO_ERROR;
} break;
case RELEASE_RECORDING_FRAME: {
ALOGV("RELEASE_RECORDING_FRAME");
CHECK_INTERFACE(ICameraRecordingProxy, data, reply);
sp<IMemory> mem = interface_cast<IMemory>(data.readStrongBinder());
releaseRecordingFrame(mem);
return NO_ERROR;
} break;
#ifndef ANDROID_DEFAULT_CODE
case GET_PARAMETERS: {
ALOGV("GET_PARAMETERS");
CHECK_INTERFACE(ICamera, data, reply);
reply->writeString8(getParameters());
return NO_ERROR;
} break;
case SET_PARAMETERS: {
ALOGV("SET_PARAMETERS");
CHECK_INTERFACE(ICamera, data, reply);
String8 params(data.readString8());
reply->writeInt32(setParameters(params));
return NO_ERROR;
} break;
#endif
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
示例11: onTransact
status_t BnDrmServiceListener::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) {
switch (code) {
case NOTIFY:
{
CHECK_INTERFACE(IDrmServiceListener, data, reply);
int uniqueId = data.readInt32();
int type = data.readInt32();
const String8& message = data.readString8();
status_t status = notify(DrmInfoEvent(uniqueId, type, message));
reply->writeInt32(status);
return DRM_NO_ERROR;
}
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
示例12: onTransact
//.........这里部分代码省略.........
int ve = data.readInt32();
reply->writeInt32(setVideoEncoder(ve));
return NO_ERROR;
} break;
case SET_AUDIO_ENCODER: {
ALOGV("SET_AUDIO_ENCODER");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int ae = data.readInt32();
reply->writeInt32(setAudioEncoder(ae));
return NO_ERROR;
} break;
case SET_OUTPUT_FILE_FD: {
ALOGV("SET_OUTPUT_FILE_FD");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int fd = dup(data.readFileDescriptor());
int64_t offset = data.readInt64();
int64_t length = data.readInt64();
reply->writeInt32(setOutputFile(fd, offset, length));
::close(fd);
return NO_ERROR;
} break;
case SET_VIDEO_SIZE: {
ALOGV("SET_VIDEO_SIZE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int width = data.readInt32();
int height = data.readInt32();
reply->writeInt32(setVideoSize(width, height));
return NO_ERROR;
} break;
case SET_VIDEO_FRAMERATE: {
ALOGV("SET_VIDEO_FRAMERATE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int frames_per_second = data.readInt32();
reply->writeInt32(setVideoFrameRate(frames_per_second));
return NO_ERROR;
} break;
case SET_PARAMETERS: {
ALOGV("SET_PARAMETER");
CHECK_INTERFACE(IMediaRecorder, data, reply);
reply->writeInt32(setParameters(data.readString8()));
return NO_ERROR;
} break;
case SET_LISTENER: {
ALOGV("SET_LISTENER");
CHECK_INTERFACE(IMediaRecorder, data, reply);
sp<IMediaRecorderClient> listener =
interface_cast<IMediaRecorderClient>(data.readStrongBinder());
reply->writeInt32(setListener(listener));
return NO_ERROR;
} break;
case SET_CLIENT_NAME: {
ALOGV("SET_CLIENT_NAME");
CHECK_INTERFACE(IMediaRecorder, data, reply);
reply->writeInt32(setClientName(data.readString16()));
return NO_ERROR;
}
case SET_PREVIEW_SURFACE: {
ALOGV("SET_PREVIEW_SURFACE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
sp<IGraphicBufferProducer> surface = interface_cast<IGraphicBufferProducer>(
data.readStrongBinder());
reply->writeInt32(setPreviewSurface(surface));
return NO_ERROR;
} break;
case SET_CAMERA: {
ALOGV("SET_CAMERA");
CHECK_INTERFACE(IMediaRecorder, data, reply);
sp<ICamera> camera = interface_cast<ICamera>(data.readStrongBinder());
sp<ICameraRecordingProxy> proxy =
interface_cast<ICameraRecordingProxy>(data.readStrongBinder());
reply->writeInt32(setCamera(camera, proxy));
return NO_ERROR;
} break;
case SET_INPUT_SURFACE: {
ALOGV("SET_INPUT_SURFACE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
sp<IGraphicBufferConsumer> surface = interface_cast<IGraphicBufferConsumer>(
data.readStrongBinder());
reply->writeInt32(setInputSurface(surface));
return NO_ERROR;
} break;
case QUERY_SURFACE_MEDIASOURCE: {
ALOGV("QUERY_SURFACE_MEDIASOURCE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
// call the mediaserver side to create
// a surfacemediasource
sp<IGraphicBufferProducer> surfaceMediaSource = querySurfaceMediaSource();
// The mediaserver might have failed to create a source
int returnedNull= (surfaceMediaSource == NULL) ? 1 : 0 ;
reply->writeInt32(returnedNull);
if (!returnedNull) {
reply->writeStrongBinder(IInterface::asBinder(surfaceMediaSource));
}
return NO_ERROR;
} break;
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
示例13: onTransact
status_t BnSurfaceComposer::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case CREATE_CONNECTION: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> b = createConnection()->asBinder();
reply->writeStrongBinder(b);
} break;
case CREATE_GRAPHIC_BUFFER_ALLOC: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> b = createGraphicBufferAlloc()->asBinder();
reply->writeStrongBinder(b);
} break;
case SET_TRANSACTION_STATE: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
size_t count = data.readInt32();
ComposerState s;
Vector<ComposerState> state;
state.setCapacity(count);
for (size_t i=0 ; i<count ; i++) {
s.read(data);
state.add(s);
}
count = data.readInt32();
DisplayState d;
Vector<DisplayState> displays;
displays.setCapacity(count);
for (size_t i=0 ; i<count ; i++) {
d.read(data);
displays.add(d);
}
uint32_t flags = data.readInt32();
setTransactionState(state, displays, flags);
} break;
case BOOT_FINISHED: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
bootFinished();
} break;
case CAPTURE_SCREEN: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> display = data.readStrongBinder();
uint32_t reqWidth = data.readInt32();
uint32_t reqHeight = data.readInt32();
uint32_t minLayerZ = data.readInt32();
uint32_t maxLayerZ = data.readInt32();
sp<IMemoryHeap> heap;
uint32_t w, h;
PixelFormat f;
status_t res = captureScreen(display, &heap, &w, &h, &f,
reqWidth, reqHeight, minLayerZ, maxLayerZ);
reply->writeStrongBinder(heap->asBinder());
reply->writeInt32(w);
reply->writeInt32(h);
reply->writeInt32(f);
reply->writeInt32(res);
} break;
case AUTHENTICATE_SURFACE: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<ISurfaceTexture> surfaceTexture =
interface_cast<ISurfaceTexture>(data.readStrongBinder());
int32_t result = authenticateSurfaceTexture(surfaceTexture) ? 1 : 0;
reply->writeInt32(result);
} break;
case CREATE_DISPLAY_EVENT_CONNECTION: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IDisplayEventConnection> connection(createDisplayEventConnection());
reply->writeStrongBinder(connection->asBinder());
return NO_ERROR;
} break;
case CREATE_DISPLAY: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
String8 displayName = data.readString8();
bool secure = bool(data.readInt32());
sp<IBinder> display(createDisplay(displayName, secure));
reply->writeStrongBinder(display);
return NO_ERROR;
} break;
case GET_BUILT_IN_DISPLAY: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
int32_t id = data.readInt32();
sp<IBinder> display(getBuiltInDisplay(id));
reply->writeStrongBinder(display);
return NO_ERROR;
} break;
case BLANK: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> display = data.readStrongBinder();
blank(display);
} break;
case UNBLANK: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> display = data.readStrongBinder();
unblank(display);
} break;
case GET_DISPLAY_INFO: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
DisplayInfo info;
sp<IBinder> display = data.readStrongBinder();
status_t result = getDisplayInfo(display, &info);
//.........这里部分代码省略.........
示例14: onTransact
status_t BnDrmManagerService::onTransact(
uint32_t code, const Parcel& data,
Parcel* reply, uint32_t flags) {
LOGV("Entering BnDrmManagerService::onTransact with code %d", code);
switch (code) {
case ADD_UNIQUEID:
{
LOGV("BnDrmManagerService::onTransact :ADD_UNIQUEID");
CHECK_INTERFACE(IDrmManagerService, data, reply);
int uniqueId = addUniqueId(data.readInt32());
reply->writeInt32(uniqueId);
return DRM_NO_ERROR;
}
case REMOVE_UNIQUEID:
{
LOGV("BnDrmManagerService::onTransact :REMOVE_UNIQUEID");
CHECK_INTERFACE(IDrmManagerService, data, reply);
removeUniqueId(data.readInt32());
return DRM_NO_ERROR;
}
case LOAD_PLUGINS:
{
LOGV("BnDrmManagerService::onTransact :LOAD_PLUGINS");
CHECK_INTERFACE(IDrmManagerService, data, reply);
status_t status = loadPlugIns(data.readInt32());
reply->writeInt32(status);
return DRM_NO_ERROR;
}
case LOAD_PLUGINS_FROM_PATH:
{
LOGV("BnDrmManagerService::onTransact :LOAD_PLUGINS_FROM_PATH");
CHECK_INTERFACE(IDrmManagerService, data, reply);
status_t status = loadPlugIns(data.readInt32(), data.readString8());
reply->writeInt32(status);
return DRM_NO_ERROR;
}
case SET_DRM_SERVICE_LISTENER:
{
LOGV("BnDrmManagerService::onTransact :SET_DRM_SERVICE_LISTENER");
CHECK_INTERFACE(IDrmManagerService, data, reply);
const int uniqueId = data.readInt32();
const sp<IDrmServiceListener> drmServiceListener
= interface_cast<IDrmServiceListener> (data.readStrongBinder());
status_t status = setDrmServiceListener(uniqueId, drmServiceListener);
reply->writeInt32(status);
return DRM_NO_ERROR;
}
case UNLOAD_PLUGINS:
{
LOGV("BnDrmManagerService::onTransact :UNLOAD_PLUGINS");
CHECK_INTERFACE(IDrmManagerService, data, reply);
const int uniqueId = data.readInt32();
status_t status = unloadPlugIns(uniqueId);
reply->writeInt32(status);
return DRM_NO_ERROR;
}
case INSTALL_DRM_ENGINE:
{
LOGV("BnDrmManagerService::onTransact :INSTALL_DRM_ENGINE");
CHECK_INTERFACE(IDrmManagerService, data, reply);
status_t status = installDrmEngine(data.readInt32(), data.readString8());
reply->writeInt32(status);
return DRM_NO_ERROR;
}
case GET_CONSTRAINTS_FROM_CONTENT:
{
LOGV("BnDrmManagerService::onTransact :GET_CONSTRAINTS_FROM_CONTENT");
CHECK_INTERFACE(IDrmManagerService, data, reply);
const int uniqueId = data.readInt32();
const String8 path = data.readString8();
DrmConstraints* drmConstraints = getConstraints(uniqueId, &path, data.readInt32());
if (NULL != drmConstraints) {
//Filling DRM Constraints contents
reply->writeInt32(drmConstraints->getCount());
DrmConstraints::KeyIterator keyIt = drmConstraints->keyIterator();
while (keyIt.hasNext()) {
const String8 key = keyIt.next();
//.........这里部分代码省略.........
示例15: onTransact
//.........这里部分代码省略.........
reply->writeInt32(setAudioSource(as));
return NO_ERROR;
}
break;
case SET_OUTPUT_FORMAT: {
LOGV("SET_OUTPUT_FORMAT");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int of = data.readInt32();
reply->writeInt32(setOutputFormat(of));
return NO_ERROR;
}
break;
case SET_VIDEO_ENCODER: {
LOGV("SET_VIDEO_ENCODER");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int ve = data.readInt32();
reply->writeInt32(setVideoEncoder(ve));
return NO_ERROR;
}
break;
case SET_AUDIO_ENCODER: {
LOGV("SET_AUDIO_ENCODER");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int ae = data.readInt32();
reply->writeInt32(setAudioEncoder(ae));
return NO_ERROR;
}
break;
case SET_OUTPUT_FILE_PATH: {
LOGV("SET_OUTPUT_FILE_PATH");
CHECK_INTERFACE(IMediaRecorder, data, reply);
const char* path = data.readCString();
reply->writeInt32(setOutputFile(path));
return NO_ERROR;
}
break;
case SET_OUTPUT_FILE_FD: {
LOGV("SET_OUTPUT_FILE_FD");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int fd = dup(data.readFileDescriptor());
int64_t offset = data.readInt64();
int64_t length = data.readInt64();
reply->writeInt32(setOutputFile(fd, offset, length));
return NO_ERROR;
}
break;
case SET_VIDEO_SIZE: {
LOGV("SET_VIDEO_SIZE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int width = data.readInt32();
int height = data.readInt32();
reply->writeInt32(setVideoSize(width, height));
return NO_ERROR;
}
break;
case SET_VIDEO_FRAMERATE: {
LOGV("SET_VIDEO_FRAMERATE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
int frames_per_second = data.readInt32();
reply->writeInt32(setVideoFrameRate(frames_per_second));
return NO_ERROR;
}
break;
case SET_PARAMETERS: {
LOGV("SET_PARAMETER");
CHECK_INTERFACE(IMediaRecorder, data, reply);
reply->writeInt32(setParameters(data.readString8()));
return NO_ERROR;
}
break;
case SET_LISTENER: {
LOGV("SET_LISTENER");
CHECK_INTERFACE(IMediaRecorder, data, reply);
sp<IMediaPlayerClient> listener =
interface_cast<IMediaPlayerClient>(data.readStrongBinder());
reply->writeInt32(setListener(listener));
return NO_ERROR;
}
break;
case SET_PREVIEW_SURFACE: {
LOGV("SET_PREVIEW_SURFACE");
CHECK_INTERFACE(IMediaRecorder, data, reply);
sp<ISurface> surface = interface_cast<ISurface>(data.readStrongBinder());
reply->writeInt32(setPreviewSurface(surface));
return NO_ERROR;
}
break;
case SET_CAMERA: {
LOGV("SET_CAMERA");
CHECK_INTERFACE(IMediaRecorder, data, reply);
sp<ICamera> camera = interface_cast<ICamera>(data.readStrongBinder());
reply->writeInt32(setCamera(camera));
return NO_ERROR;
}
break;
default:
return BBinder::onTransact(code, data, reply, flags);
}
}