diff --git a/include/mcc_decode.h b/include/mcc_decode.h index aa7e3be..f242ecc 100644 --- a/include/mcc_decode.h +++ b/include/mcc_decode.h @@ -159,4 +159,6 @@ boolean MccDecodeAddSink( Context*, LinkInfo ); uint8 MccDecodeProcNextBuffer( void*, Buffer* ); uint8 MccDecodeShutdown( void* ); +Buffer* decodeMccLine( MccDecodeCtx*, Buffer* ); + #endif /* mcc_decode_h */ diff --git a/include/mcc_encode.h b/include/mcc_encode.h index 24f668a..59ad8b5 100644 --- a/include/mcc_encode.h +++ b/include/mcc_encode.h @@ -49,4 +49,10 @@ boolean MccEncodeAddSink( Context*, LinkInfo ); uint8 MccEncodeProcNextBuffer( void*, Buffer* ); uint8 MccEncodeShutdown( void* ); +/* Exposed for use as a shared library */ +boolean generateMccHeader( Context*, CaptionTime* ); +boolean sendMccText( Context*, char*, CaptionTime* ); +uint16 countChars( uint8*, uint16 ); +void compressData( uint8*, uint16, Buffer* ); + #endif /* mcc_encode_h */ diff --git a/src/Makefile b/src/Makefile index 452ef1f..6ee384f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -79,6 +79,7 @@ ################################################################################ DYLIB_NAME = libci.1.0.0.dylib +SO_NAME = libci.so UNAME := $(shell uname) @@ -162,10 +163,11 @@ ci_with_gpac: with_gpac ${CI_SHARED_LIB}: $(OBJS_WITH_PATH) @echo "\n*** Compiling Caption Inspector Dynamic Library to interface with Python. ***" clang $(SO_FLAGS) -o ${CI_SHARED_LIB} $(OBJS_IN_OBJ_DIR) + cd ../lib; ln -s ${CI_SHARED_LIB} libci.so clean: @echo "*** Cleaning Target Files. ***" - rm -f ${CI_EXECUTABLE} ${CI_SHARED_LIB} + rm -f ${CI_EXECUTABLE} ${CI_SHARED_LIB} ../lib/libci.so @echo "\n*** Cleaning Object Files. ***" for i in $(OBJS) ; do ( rm -f ../obj/$$i ) ; done rm -f ../obj/main.o diff --git a/src/xform/mcc_decode.c b/src/xform/mcc_decode.c index 7e46142..32b3344 100644 --- a/src/xform/mcc_decode.c +++ b/src/xform/mcc_decode.c @@ -38,7 +38,6 @@ /*----------------------------------------------------------------------------*/ static Buffer* expandMccLine( Buffer* ); -static Buffer* decodeMccLine( MccDecodeCtx*, Buffer* ); static uint8 mccCharCount( char ); static void addMultipleFaZeroZero( uint8, uint8*, uint16* ); static void expandMccCode( uint8, uint8*, uint16* ); @@ -281,7 +280,7 @@ static Buffer* expandMccLine( Buffer* buffPtr ) { | (Specifically: SMPTE ST 334-2:2015 - Revision of SMPTE 334-2-2007) | CEA-708-D - CEA Standard - Digital Television (DTV) Closed Captioning - August 2008 -------------------------------------------------------------------------------*/ -static Buffer* decodeMccLine( MccDecodeCtx* ctxPtr, Buffer* buffPtr ) { +Buffer* decodeMccLine( MccDecodeCtx* ctxPtr, Buffer* buffPtr ) { ASSERT(buffPtr); ASSERT(buffPtr->dataPtr); ASSERT(buffPtr->numElements); diff --git a/src/xform/mcc_encode.c b/src/xform/mcc_encode.c index 072beb2..605db3b 100644 --- a/src/xform/mcc_encode.c +++ b/src/xform/mcc_encode.c @@ -44,13 +44,9 @@ const char* DayOfWeekStr[7] = { "Sunday", "Monday", "Tuesday", "Wednesday", /*-- Private Member Declarations --*/ /*----------------------------------------------------------------------------*/ -static boolean generateMccHeader( Context*, CaptionTime* ); static void addFillPacket( Context*, CaptionTime* ); static CaptionTime convertCaptionTime( Context*, CaptionTime* ); -static boolean sendMccText( Context*, char*, CaptionTime* ); static Buffer* addBoilerplate( MccEncodeCtx*, Buffer* ); -static uint16 countChars( uint8*, uint16 ); -static void compressData( uint8*, uint16, Buffer* ); /*----------------------------------------------------------------------------*/ /*-- Public Member Functions --*/ @@ -234,7 +230,7 @@ uint8 MccEncodeShutdown( void* rootCtxPtr ) { | This function will build the standard MCC Header and send it line by line | to the next component in the pipeline. -------------------------------------------------------------------------------*/ -static boolean generateMccHeader( Context* ctxPtr, CaptionTime* captionTimePtr ) { +boolean generateMccHeader( Context* ctxPtr, CaptionTime* captionTimePtr ) { uuid_t binuuid; char uuidStr[50]; char dateStr[50]; @@ -463,7 +459,7 @@ static CaptionTime convertCaptionTime( Context* rootCtxPtr, CaptionTime* inCapti | DESCRIPTION: | This function sends a line of text to the next component in the pipeline. -------------------------------------------------------------------------------*/ -static boolean sendMccText( Context* ctxPtr, char* textStr, CaptionTime* captionTimePtr ) { +boolean sendMccText( Context* ctxPtr, char* textStr, CaptionTime* captionTimePtr ) { Buffer* outputBuffer = NewBuffer(BUFFER_TYPE_BYTES, (strlen(textStr)+1)); strcpy((char*)outputBuffer->dataPtr, textStr); @@ -553,7 +549,7 @@ static Buffer* addBoilerplate( MccEncodeCtx* ctxPtr, Buffer* inBufferPtr ) { | U E1h 00h 00h 00h | Z 00h -------------------------------------------------------------------------------*/ -static uint16 countChars( uint8* dataPtr, uint16 numElements ) { +uint16 countChars( uint8* dataPtr, uint16 numElements ) { uint16 numChars = 1; while( numElements > 0 ) { @@ -663,7 +659,7 @@ static uint16 countChars( uint8* dataPtr, uint16 numElements ) { | U E1h 00h 00h 00h | Z 00h -------------------------------------------------------------------------------*/ -static void compressData( uint8* dataPtr, uint16 numElements, Buffer* outBufPtr ) { +void compressData( uint8* dataPtr, uint16 numElements, Buffer* outBufPtr ) { uint8* outDataPtr = &outBufPtr->dataPtr[12]; while( numElements > 0 ) {