Skip to content

Instantly share code, notes, and snippets.

@giantpune
Last active December 10, 2015 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giantpune/996b156fe9020fd550a5 to your computer and use it in GitHub Desktop.
Save giantpune/996b156fe9020fd550a5 to your computer and use it in GitHub Desktop.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
service.cpp \
LOCAL_C_INCLUDES += external/stlport/stlport/ \
bionic \
bionic/libstdc++/include \
frameworks/av/include/ndk \
frameworks/av/media/libstagefright/include/ \
frameworks/av/include/media/stagefright/foundation/ \
frameworks/av/include/media/stagefright/ \
frameworks/native/include/media/openmax/
LOCAL_SHARED_LIBRARIES += libutils libbinder libmedia libcutils libgui libstagefright libstagefright_foundation libstagefright_omx
#LOCAL_STATIC_LIBRARIES += libmediandk
LOCAL_LDLIBS += -lutils -lbinder -lmedia -lstagefright -lstagefright_foundation
ifeq ($(TARGET_OS),linux)
LOCAL_CFLAGS += -DXP_UNIX
#LOCAL_SHARED_LIBRARIES += librt
endif
LOCAL_CFLAGS += -O0
CFLAGS += -S
LOCAL_MODULE:= test_24090395
include $(BUILD_EXECUTABLE)
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <utils/Log.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <media/IMediaPlayerService.h>
#include <media/IOMX.h>
#include <OMXNodeInstance.h>
using namespace android;
int main(){
const sp<IOMXObserver> observer;
OMXNodeInstance *ni = new OMXNodeInstance( NULL, observer, "franks_and_beans" );
IOMX::node_id node = 4;
// edit the header to make this public so it compiles
OMX_BUFFERHEADERTYPE *header = ni->findBufferHeader( node );
size_t id = (size_t)(header);
switch( id )
{
case 0:
printf( "its patched\n" );
return 1;
case 4:
printf( "its not patched\n" );
return 0;
default:
printf("ret is %d. the test is broken\n", id );
return -1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment