author | Tellen Yu <tellen.yu@amlogic.com> | 2016-10-09 10:49:31 (GMT) |
---|---|---|
committer | Tellen Yu <tellen.yu@amlogic.com> | 2016-10-09 10:49:31 (GMT) |
commit | 2d5ca94ef31d7d3974c3f46e25d606ae43c7c66f (patch) | |
tree | af7b41340087255ea8a63ba24b913ab932f6fd7d | |
parent | 998826e900ee4c253f60a04cb221454eeb4ceaf6 (diff) | |
download | SubTitle-2d5ca94ef31d7d3974c3f46e25d606ae43c7c66f.zip SubTitle-2d5ca94ef31d7d3974c3f46e25d606ae43c7c66f.tar.gz SubTitle-2d5ca94ef31d7d3974c3f46e25d606ae43c7c66f.tar.bz2 |
64bit compatibility
Change-Id: Ib41313e8fff33e9ff0bbb880f6f200fc5dfc8d86
-rw-r--r-- | jni/subtitle/log_print.c | 1 | ||||
-rw-r--r-- | jni/subtitle/sub_api.c | 1 | ||||
-rw-r--r-- | jni/subtitle/sub_dvb_sub.c | 71 | ||||
-rw-r--r-- | jni/subtitle/sub_dvb_sub.h | 68 | ||||
-rw-r--r-- | jni/subtitle/sub_jni.c | 4 | ||||
-rw-r--r-- | jni/subtitle/sub_pgs_sub.c | 1 | ||||
-rw-r--r-- | jni/subtitle/sub_subtitle.c | 3 | ||||
-rw-r--r-- | jni/subtitle/sub_subtitle.h | 23 | ||||
-rw-r--r-- | jni/subtitle/sub_vob_sub.c | 1 | ||||
-rw-r--r-- | jni/subtitle/sub_vob_sub.h | 1 | ||||
-rw-r--r-- | jni/subtitle/vob_sub.c | 5 | ||||
-rw-r--r-- | jni/subtitle/vob_sub.h | 7 |
12 files changed, 115 insertions, 71 deletions
diff --git a/jni/subtitle/log_print.c b/jni/subtitle/log_print.c index 015dc10..b9c4daa 100644 --- a/jni/subtitle/log_print.c +++ b/jni/subtitle/log_print.c @@ -4,6 +4,7 @@ #include <stdio.h> #include <stdarg.h> #include <string.h> +#include <stdlib.h> #define LOG_TAG "sub_api" #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) diff --git a/jni/subtitle/sub_api.c b/jni/subtitle/sub_api.c index d364022..70309cf 100644 --- a/jni/subtitle/sub_api.c +++ b/jni/subtitle/sub_api.c @@ -16,6 +16,7 @@ #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> +#include <unistd.h> #include "list.h" #include "sub_api.h" diff --git a/jni/subtitle/sub_dvb_sub.c b/jni/subtitle/sub_dvb_sub.c index 9e27bd4..583f228 100644 --- a/jni/subtitle/sub_dvb_sub.c +++ b/jni/subtitle/sub_dvb_sub.c @@ -8,6 +8,7 @@ */ #include "sub_dvb_sub.h" +#include "sub_subtitle.h" static unsigned SPU_RD_HOLD_SIZE = 0x20; #define OSD_HALF_SIZE (1920*1280/8) @@ -145,6 +146,76 @@ static void png_save(const char *filename, uint8_t *bitmap, int w, int h, system(command); } #endif + +#if 1 +void *av_malloc(unsigned int size) +{ + void *ptr = NULL; + ptr = malloc(size); + return ptr; +} + +void *av_realloc(void *ptr, unsigned int size) +{ + return realloc(ptr, size); +} + +void av_freep(void **arg) +{ + if (*arg) + free(*arg); + *arg = NULL; +} + +void av_free(void *arg) +{ + if (arg) + free(arg); +} + +void *av_mallocz(unsigned int size) +{ + void *ptr = malloc(size); + if (ptr) + memset(ptr, 0, size); + return ptr; +} + +static inline uint32_t bytestream_get_be32(const uint8_t **ptr) +{ + uint32_t tmp; + tmp = + (*ptr)[3] | ((*ptr)[2] << 8) | ((*ptr)[1] << 16) | ((*ptr)[0] << + 24); + *ptr += 4; + return tmp; +} + +static inline uint32_t bytestream_get_be24(const uint8_t **ptr) +{ + uint32_t tmp; + tmp = (*ptr)[2] | ((*ptr)[1] << 8) | ((*ptr)[0] << 16); + *ptr += 3; + return tmp; +} + +static inline uint32_t bytestream_get_be16(const uint8_t **ptr) +{ + uint32_t tmp; + tmp = (*ptr)[1] | ((*ptr)[0] << 8); + *ptr += 2; + return tmp; +} + +static inline uint8_t bytestream_get_byte(const uint8_t **ptr) +{ + uint8_t tmp; + tmp = **ptr; + *ptr += 1; + return tmp; +} +#endif + static int dvb_sub_valid_flag = 0; static void png_save2(const char *filename, uint32_t *bitmap, int w, int h) { diff --git a/jni/subtitle/sub_dvb_sub.h b/jni/subtitle/sub_dvb_sub.h index aa0591b..382649f 100644 --- a/jni/subtitle/sub_dvb_sub.h +++ b/jni/subtitle/sub_dvb_sub.h @@ -482,73 +482,5 @@ int dvbsub_decode(AML_SPUVAR *spu, const uint8_t *psrc, const int size); av_cold int dvbsub_init_decoder(); av_cold int dvbsub_close_decoder(); -#if 1 -void *av_malloc(unsigned int size) -{ - void *ptr = NULL; - ptr = malloc(size); - return ptr; -} - -void *av_realloc(void *ptr, unsigned int size) -{ - return realloc(ptr, size); -} - -void av_freep(void **arg) -{ - if (*arg) - free(*arg); - *arg = NULL; -} - -void av_free(void *arg) -{ - if (arg) - free(arg); -} - -void *av_mallocz(unsigned int size) -{ - void *ptr = malloc(size); - if (ptr) - memset(ptr, 0, size); - return ptr; -} - -static inline uint32_t bytestream_get_be32(const uint8_t **ptr) -{ - uint32_t tmp; - tmp = - (*ptr)[3] | ((*ptr)[2] << 8) | ((*ptr)[1] << 16) | ((*ptr)[0] << - 24); - *ptr += 4; - return tmp; -} - -static inline uint32_t bytestream_get_be24(const uint8_t **ptr) -{ - uint32_t tmp; - tmp = (*ptr)[2] | ((*ptr)[1] << 8) | ((*ptr)[0] << 16); - *ptr += 3; - return tmp; -} - -static inline uint32_t bytestream_get_be16(const uint8_t **ptr) -{ - uint32_t tmp; - tmp = (*ptr)[1] | ((*ptr)[0] << 8); - *ptr += 2; - return tmp; -} - -static inline uint8_t bytestream_get_byte(const uint8_t **ptr) -{ - uint8_t tmp; - tmp = **ptr; - *ptr += 1; - return tmp; -} -#endif #endif diff --git a/jni/subtitle/sub_jni.c b/jni/subtitle/sub_jni.c index 22ad6f9..8bf596b 100644 --- a/jni/subtitle/sub_jni.c +++ b/jni/subtitle/sub_jni.c @@ -7,9 +7,11 @@ #include <sys/types.h> #include <signal.h> #include <unistd.h> +#include <stdlib.h> #include <pthread.h> #include <Amsyswrite.h> +#include "sub_subtitle.h" #include "sub_set_sys.h" #include "vob_sub.h" @@ -525,7 +527,7 @@ JNIEXPORT jobject JNICALL getidxsubrawdata(JNIEnv *env, jclass cl, jint msec) } LOGE("start parser_data spu_alpha=0x%x \n", vobsub->vob_subtitle_config.contrast); - idxsub_parser_data(vobsub->vob_subtitle_config.prtData, raw_byte, + idxsub_parser_data((unsigned char *)vobsub->vob_subtitle_config.prtData, raw_byte, (vobsub->vob_subtitle_config.width) / 4, idxsubdata, vobsub->vob_subtitle_config.contrast); LOGE("parser_data over\n\n"); diff --git a/jni/subtitle/sub_pgs_sub.c b/jni/subtitle/sub_pgs_sub.c index 7eec09c..50d6d3a 100644 --- a/jni/subtitle/sub_pgs_sub.c +++ b/jni/subtitle/sub_pgs_sub.c @@ -1,5 +1,6 @@ #include <unistd.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <errno.h> #include <getopt.h> diff --git a/jni/subtitle/sub_subtitle.c b/jni/subtitle/sub_subtitle.c index 3cfc30e..6642ff4 100644 --- a/jni/subtitle/sub_subtitle.c +++ b/jni/subtitle/sub_subtitle.c @@ -8,6 +8,7 @@ //header file #include <unistd.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <errno.h> #include <getopt.h> @@ -22,7 +23,9 @@ #include "sub_control.h" #include "sub_subtitle.h" #include "sub_vob_sub.h" +#include "sub_dvb_sub.h" #include "sub_pgs_sub.h" +#include "sub_set_sys.h" typedef struct _DivXSubPictColor { diff --git a/jni/subtitle/sub_subtitle.h b/jni/subtitle/sub_subtitle.h index f003568..356e5e7 100644 --- a/jni/subtitle/sub_subtitle.h +++ b/jni/subtitle/sub_subtitle.h @@ -73,5 +73,28 @@ int subtitle_thread_create(); int init_subtitle_file(); int close_subtitle(); void set_subthread(int runing); +int write_subtitle_file(AML_SPUVAR *spu); +int get_inter_sub_type(); +int get_inter_spu_resize_size(); +int *parser_inter_spu(int *buffer); +int get_inter_spu_origin_width(); +int get_inter_spu_origin_height(); +char *get_inter_spu_data(); +int fill_resize_data(int *dst_data, int *src_data); +void free_last_inter_spu_data(); +int get_inter_spu_width(); +int get_inter_spu_height(); +unsigned get_inter_spu_pts(); +int add_read_position(); +unsigned get_inter_spu_delay(); +int get_subtitle_buffer_size(); +int get_inter_spu_packet(int pts); +int get_inter_spu_type(); +int add_file_position(); +int get_inter_spu_size(); + +extern unsigned char FillPixel(char *ptrPXDRead, char *pixelOut, int n, + AML_SPUVAR *sub_frame, int field_offset); +extern int get_dvb_spu(AML_SPUVAR *spu, int read_handle); #endif diff --git a/jni/subtitle/sub_vob_sub.c b/jni/subtitle/sub_vob_sub.c index 96186af..62819ca 100644 --- a/jni/subtitle/sub_vob_sub.c +++ b/jni/subtitle/sub_vob_sub.c @@ -10,6 +10,7 @@ #include <stdio.h> #include <string.h> #include <errno.h> +#include <stdlib.h> #include <android/log.h> //#include "codec.h" diff --git a/jni/subtitle/sub_vob_sub.h b/jni/subtitle/sub_vob_sub.h index 073e9d5..4b6e407 100644 --- a/jni/subtitle/sub_vob_sub.h +++ b/jni/subtitle/sub_vob_sub.h @@ -6,6 +6,7 @@ int get_vob_spu(char *input_buf, int *buf_size, unsigned length, AML_SPUVAR *spu); void dvdsub_init_decoder(void); +unsigned short doDCSQC(unsigned char *pdata, unsigned char *pend); typedef enum { diff --git a/jni/subtitle/vob_sub.c b/jni/subtitle/vob_sub.c index 60a19a0..52d8320 100644 --- a/jni/subtitle/vob_sub.c +++ b/jni/subtitle/vob_sub.c @@ -11,12 +11,15 @@ #include <string.h> #include <ctype.h> #include <fcntl.h> +#include <unistd.h> #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> #include "log_print.h" #include "vob_sub.h" +#include "sub_vob_sub.h" + #include <cutils/properties.h> #include <android/log.h> @@ -1448,7 +1451,7 @@ unsigned char vob_fill_pixel(subtitlevobsub_t *subtitlevobsub, int n) return 0; } -//extern unsigned short doDCSQC(unsigned char *pdata,unsigned char *pend); +extern unsigned short doDCSQC(unsigned char *pdata,unsigned char *pend); static int do_vob_sub_cmd(subtitlevobsub_t *subtitlevobsub, unsigned char *packet) diff --git a/jni/subtitle/vob_sub.h b/jni/subtitle/vob_sub.h index d391d80..e7ebc79 100644 --- a/jni/subtitle/vob_sub.h +++ b/jni/subtitle/vob_sub.h @@ -89,7 +89,7 @@ typedef struct int height; unsigned short colorcode; unsigned short contrast; - unsigned prtData; + unsigned long prtData; unsigned cls; } Vob_subtitle_showdata; @@ -233,5 +233,10 @@ extern int init_subtitle(char *fileurl); extern subtitlevobsub_t *getIdxSubData(int ptms); +void idxsub_parser_data(const unsigned char *source, long length, int linewidth, + unsigned int *dist, int subtitle_alpha); +void idxsub_close_subtitle(); +int idxsub_init_subtitle(char *fileurl, int index); + /*@}*/ #endif /* VOB_SUB_H */ |