1
0
mirror of https://github.com/ioacademy-jikim/multimedia synced 2026-08-22 22:02:57 +00:00

멀티미디어 예제

This commit is contained in:
ioacademy-jikim
2015-08-04 19:14:13 +09:00
commit d3b375295e
59 changed files with 8232 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= server.cpp
LOCAL_MODULE := my_server
LOCAL_SHARED_LIBRARIES:= libcutils libutils libbinder
LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= client.cpp
LOCAL_MODULE := my_client
LOCAL_SHARED_LIBRARIES:= libcutils libutils libbinder
LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)
+17
View File
@@ -0,0 +1,17 @@
#include <binder/IServiceManager.h>
#include <utils/StrongPointer.h>
#include <binder/MemoryHeapBase.h>
#include <binder/IPCThreadState.h>
#include <stdio.h>
using namespace android;
int main()
{
sp<IServiceManager> sm = defaultServiceManager();
sp<IBinder> binder = sm->getService( String16("my.ashmem1") );
sp<IMemoryHeap> heap = interface_cast<IMemoryHeap>(binder);
char *p = (char*)heap->getBase();
printf("[%s]\n", p );
return 0;
}
+18
View File
@@ -0,0 +1,18 @@
#include <binder/IServiceManager.h>
#include <utils/StrongPointer.h>
#include <binder/MemoryHeapBase.h>
#include <binder/IPCThreadState.h>
using namespace android;
int main()
{
sp<IServiceManager> sm = defaultServiceManager();
sp<MemoryHeapBase> heap = new MemoryHeapBase(4096);
sm->addService( String16("my.ashmem1") , heap );
char *p = (char*)heap->getBase();
sprintf(p, "Hello Client!!\n" );
IPCThreadState::self()->joinThreadPool();
return 0;
}