diff options
author | Jamie Gennis <jgennis@google.com> | 2010-08-10 16:37:53 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2010-08-23 14:31:30 -0700 |
commit | 4b79168835965cf0fc41ebe2a367e22b4cb20d08 (patch) | |
tree | d70a673d243fdc72171ecbcf51094554f947987a /media/libmedia/IMediaRecorder.cpp | |
parent | 82252a9a732c7325166c36589c1dfa9f2cb8ac04 (diff) | |
download | frameworks_av-4b79168835965cf0fc41ebe2a367e22b4cb20d08.zip frameworks_av-4b79168835965cf0fc41ebe2a367e22b4cb20d08.tar.gz frameworks_av-4b79168835965cf0fc41ebe2a367e22b4cb20d08.tar.bz2 |
Change the framework to use the new camera preview path.
This change makes the camera HAL interface take an ANativeWindow interface from
which all the camera preview buffers will be allocated. The framework code
running in application processes now passes a Surface object rather than an
ISurface to the camera server via Binder when setting the preview surface. The
camera server then forwards that Surface object (which implements the
ANativeWindow interface) to the camera HAL, which uses it to communicate with
SurfaceFlinger to allocate the camera preview buffers.
Change-Id: Ie438f721559cd7de5e4f848a26d96360dda07b5f
Diffstat (limited to 'media/libmedia/IMediaRecorder.cpp')
-rw-r--r-- | media/libmedia/IMediaRecorder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/media/libmedia/IMediaRecorder.cpp b/media/libmedia/IMediaRecorder.cpp index 947ff34..f55a01e 100644 --- a/media/libmedia/IMediaRecorder.cpp +++ b/media/libmedia/IMediaRecorder.cpp @@ -19,7 +19,7 @@ #define LOG_TAG "IMediaRecorder" #include <utils/Log.h> #include <binder/Parcel.h> -#include <surfaceflinger/ISurface.h> +#include <surfaceflinger/Surface.h> #include <camera/ICamera.h> #include <media/IMediaRecorderClient.h> #include <media/IMediaRecorder.h> @@ -69,12 +69,12 @@ public: return reply.readInt32(); } - status_t setPreviewSurface(const sp<ISurface>& surface) + status_t setPreviewSurface(const sp<Surface>& surface) { LOGV("setPreviewSurface(%p)", surface.get()); Parcel data, reply; data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor()); - data.writeStrongBinder(surface->asBinder()); + Surface::writeToParcel(surface, &data); remote()->transact(SET_PREVIEW_SURFACE, data, &reply); return reply.readInt32(); } @@ -409,7 +409,7 @@ status_t BnMediaRecorder::onTransact( case SET_PREVIEW_SURFACE: { LOGV("SET_PREVIEW_SURFACE"); CHECK_INTERFACE(IMediaRecorder, data, reply); - sp<ISurface> surface = interface_cast<ISurface>(data.readStrongBinder()); + sp<Surface> surface = Surface::readFromParcel(data); reply->writeInt32(setPreviewSurface(surface)); return NO_ERROR; } break; |