-rw-r--r-- | Android.mk | 3 | ||||
-rw-r--r-- | audio_hw.c | 531 | ||||
-rw-r--r-- | audio_hw.h | 18 | ||||
-rw-r--r-- | audio_hw_profile.c | 31 | ||||
-rw-r--r-- | audio_hwsync.c | 29 | ||||
-rw-r--r-- | audio_hwsync.h | 17 | ||||
-rw-r--r-- | spdifenc_wrap.cpp | 26 |
7 files changed, 290 insertions, 365 deletions
diff --git a/audio_hwsync.h b/audio_hwsync.h index 491ab7e..99bf8ae 100644 --- a/audio_hwsync.h +++ b/audio_hwsync.h @@ -16,9 +16,9 @@ typedef struct audio_hwsync { uint8_t hw_sync_header[16]; - int hw_sync_header_cnt; + size_t hw_sync_header_cnt; int hw_sync_state; - int hw_sync_body_cnt; + size_t hw_sync_body_cnt; int hw_sync_frame_size; uint8_t hw_sync_body_buf[4096]; uint8_t body_align[64]; @@ -55,4 +55,17 @@ static inline uint32_t hwsync_header_get_size(uint8_t *header) ((uint32_t)header[7]); } +static inline uint64_t pts_abs(uint64_t a, uint64_t b) +{ + if (a >= b) + return (a - b); + else + return (b - a); +} + +struct aml_stream_out; + +void aml_audio_hwsync_clear_status(struct aml_stream_out *out); +int aml_audio_hwsync_find_frame(struct aml_stream_out *out, + const void *in_buffer, size_t in_bytes, uint64_t *cur_pts, int *outsize); #endif |