mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 15:32:43 +02:00
libeplayer3-arm: Code formatting
Origin commit data
------------------
Branch: master
Commit: 06854b0e78
Author: max_10 <max_10@gmx.de>
Date: 2018-01-17 (Wed, 17 Jan 2018)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -103,8 +103,7 @@ static void update_finish_timeout()
|
||||
/* On some STBs PTS readed from decoder is invalid after seek or at start
|
||||
* this is the reason for additional validation when we what to close immediately
|
||||
*/
|
||||
if (!progressive_playback && 0 == ret && currPts >= maxInjectedPts &&
|
||||
((currPts - maxInjectedPts) / 90000) < 2)
|
||||
if (!progressive_playback && 0 == ret && currPts >= maxInjectedPts && ((currPts - maxInjectedPts) / 90000) < 2)
|
||||
{
|
||||
/* close immediately
|
||||
*/
|
||||
@@ -250,7 +249,7 @@ static void ffmpeg_filler(Context_t *context, int32_t id, int32_t *inpause, int3
|
||||
return;
|
||||
}
|
||||
while ((flag == 0 && avContextTab[0] != NULL && avContextTab[0]->pb != NULL && rwdiff > FILLBUFDIFF) ||
|
||||
(flag == 1 && hasfillerThreadStarted[id] == 1 && avContextTab[0] != NULL && avContextTab[0]->pb != NULL && rwdiff > FILLBUFDIFF))
|
||||
(flag == 1 && hasfillerThreadStarted[id] == 1 && avContextTab[0] != NULL && avContextTab[0]->pb != NULL && rwdiff > FILLBUFDIFF))
|
||||
{
|
||||
if (0 == PlaybackDieNow(0))
|
||||
{
|
||||
|
@@ -68,7 +68,7 @@ static void printContainerCapabilities()
|
||||
container_printf(10, "\n");
|
||||
}
|
||||
|
||||
static int32_t selectContainer(Context_t *context, char *extension)
|
||||
static int32_t selectContainer(Context_t *context, char *extension)
|
||||
{
|
||||
int32_t i = 0;
|
||||
int32_t j = 0;
|
||||
|
@@ -720,7 +720,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
#endif
|
||||
#ifdef HAVE_FLV2MPEG4_CONVERTER
|
||||
if (get_codecpar(avContextTab[cAVIdx]->streams[packet.stream_index])->codec_id == AV_CODEC_ID_FLV1 &&
|
||||
0 == memcmp(videoTrack->Encoding, "V_MPEG4", 7))
|
||||
0 == memcmp(videoTrack->Encoding, "V_MPEG4", 7))
|
||||
{
|
||||
flv2mpeg4_write_packet(context, &flv2mpeg4_context, videoTrack, cAVIdx, ¤tVideoPts, &latestPts, &packet);
|
||||
update_max_injected_pts(latestPts);
|
||||
@@ -980,7 +980,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
if (e < 0)
|
||||
{
|
||||
ffmpeg_err("swr_init: %d (icl=%d ocl=%d isr=%d osr=%d isf=%d osf=%d\n",
|
||||
-e, (int32_t)c->channel_layout, (int32_t)out_channel_layout, c->sample_rate, out_sample_rate, c->sample_fmt, AV_SAMPLE_FMT_S16);
|
||||
-e, (int32_t)c->channel_layout, (int32_t)out_channel_layout, c->sample_rate, out_sample_rate, c->sample_fmt, AV_SAMPLE_FMT_S16);
|
||||
swr_free(&swr);
|
||||
swr = NULL;
|
||||
}
|
||||
@@ -995,11 +995,11 @@ static void FFMPEGThread(Context_t *context)
|
||||
continue;
|
||||
}
|
||||
int64_t next_in_pts = av_rescale(av_frame_get_best_effort_timestamp(decoded_frame),
|
||||
((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate,
|
||||
((AVStream *) audioTrack->stream)->time_base.den);
|
||||
((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate,
|
||||
((AVStream *) audioTrack->stream)->time_base.den);
|
||||
int64_t next_out_pts = av_rescale(swr_next_pts(swr, next_in_pts),
|
||||
((AVStream *) audioTrack->stream)->time_base.den,
|
||||
((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate);
|
||||
((AVStream *) audioTrack->stream)->time_base.den,
|
||||
((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate);
|
||||
currentAudioPts = audioTrack->pts = pts = calcPts(cAVIdx, audioTrack->stream, next_out_pts);
|
||||
out_samples = swr_convert(swr, &output[0], out_samples, (const uint8_t **) &decoded_frame->data[0], in_samples);
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -1109,9 +1109,9 @@ static void FFMPEGThread(Context_t *context)
|
||||
printf("{\"log\":\"Frame read error: '%s'\"}\n", errbuf);
|
||||
}
|
||||
/*
|
||||
if( ffmpegStatus == AVERROR(EAGAIN) )
|
||||
if(ffmpegStatus == AVERROR(EAGAIN))
|
||||
{
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
ffmpegStatus = 0;
|
||||
@@ -1262,8 +1262,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
avContextTab[AVIdx]->interrupt_callback.callback = interrupt_cb;
|
||||
avContextTab[AVIdx]->interrupt_callback.opaque = context->playback;
|
||||
#ifdef SAM_CUSTOM_IO
|
||||
if (0 == strstr(filename, "://") ||
|
||||
0 == strncmp(filename, "file://", 7))
|
||||
if (0 == strstr(filename, "://") || 0 == strncmp(filename, "file://", 7))
|
||||
{
|
||||
AVIOContext *avio_ctx = container_ffmpeg_get_avio_context(filename, 4096);
|
||||
if (avio_ctx)
|
||||
@@ -1294,11 +1293,11 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
rtmpProtoImplType = RTMP_LIBRTMP;
|
||||
}
|
||||
if (0 == strncmp(filename, "rtmp://", 7) ||
|
||||
0 == strncmp(filename, "rtmpe://", 8) ||
|
||||
0 == strncmp(filename, "rtmps://", 8) ||
|
||||
0 == strncmp(filename, "rtmpt://", 8) ||
|
||||
0 == strncmp(filename, "rtmpte://", 9) ||
|
||||
0 == strncmp(filename, "rtmpts://", 9))
|
||||
0 == strncmp(filename, "rtmpe://", 8) ||
|
||||
0 == strncmp(filename, "rtmps://", 8) ||
|
||||
0 == strncmp(filename, "rtmpt://", 8) ||
|
||||
0 == strncmp(filename, "rtmpte://", 9) ||
|
||||
0 == strncmp(filename, "rtmpts://", 9))
|
||||
{
|
||||
/* At first we need to check which protocol
|
||||
* implementations we have
|
||||
@@ -1335,8 +1334,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
* unless uri contain param wich can be understandable
|
||||
* only by librtmp
|
||||
*/
|
||||
if (strstr(filename, " token=") ||
|
||||
strstr(filename, " jtv="))
|
||||
if (strstr(filename, " token=") || strstr(filename, " jtv="))
|
||||
{
|
||||
rtmpProtoImplType = RTMP_LIBRTMP;
|
||||
}
|
||||
@@ -1480,8 +1478,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (0 == strncmp(filename, "http://", 7) ||
|
||||
0 == strncmp(filename, "https://", 8))
|
||||
else if (0 == strncmp(filename, "http://", 7) || 0 == strncmp(filename, "https://", 8))
|
||||
{
|
||||
av_dict_set(&avio_opts, "timeout", "20000000", 0); //20sec
|
||||
av_dict_set(&avio_opts, "reconnect", "1", 0);
|
||||
@@ -1496,8 +1493,8 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
if ((err = avformat_open_input(&avContextTab[AVIdx], filename, fmt, pavio_opts)) != 0)
|
||||
{
|
||||
if (rtmp_proto_impl == 0 && //err == AVERROR_UNKNOWN &&
|
||||
rtmpProtoImplType == RTMP_NATIVE &&
|
||||
numOfRTMPImpl > 1)
|
||||
rtmpProtoImplType == RTMP_NATIVE &&
|
||||
numOfRTMPImpl > 1)
|
||||
{
|
||||
// retry with librtmp
|
||||
err = avformat_open_input(&avContextTab[AVIdx], filename + 2, fmt, pavio_opts);
|
||||
@@ -1533,8 +1530,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
if (avContextTab[AVIdx] != NULL && avContextTab[AVIdx]->pb != NULL && !context->playback->isTSLiveMode)
|
||||
{
|
||||
ffmpeg_real_read_org = avContextTab[AVIdx]->pb->read_packet;
|
||||
if (0 == AVIdx && strstr(filename, "://") != 0 &&
|
||||
strncmp(filename, "file://", 7) != 0)
|
||||
if (0 == AVIdx && strstr(filename, "://") != 0 && strncmp(filename, "file://", 7) != 0)
|
||||
{
|
||||
if (ffmpeg_buf_size > 0 && ffmpeg_buf_size > FILLBUFDIFF + FILLBUFPAKET)
|
||||
{
|
||||
@@ -1602,7 +1598,7 @@ int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames)
|
||||
avformat_network_init();
|
||||
// SULGE DEBUG ENABLED
|
||||
// make ffmpeg silen
|
||||
// av_log_set_level( AV_LOG_DEBUG );
|
||||
// av_log_set_level(AV_LOG_DEBUG);
|
||||
av_log_set_callback(ffmpeg_silen_callback);
|
||||
context->playback->abortRequested = 0;
|
||||
int32_t res = container_ffmpeg_init_av_context(context, playFilesNames->szFirstFile, 0);
|
||||
@@ -1728,9 +1724,9 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
||||
continue; // skip this stream
|
||||
}
|
||||
encoding = Codec2Encoding((int32_t)get_codecpar(stream)->codec_id, (int32_t)get_codecpar(stream)->codec_type, \
|
||||
(uint8_t *)get_codecpar(stream)->extradata, \
|
||||
(int)get_codecpar(stream)->extradata_size, \
|
||||
(int)get_codecpar(stream)->profile, &version);
|
||||
(uint8_t *)get_codecpar(stream)->extradata, \
|
||||
(int)get_codecpar(stream)->extradata_size, \
|
||||
(int)get_codecpar(stream)->profile, &version);
|
||||
if (encoding != NULL && !strncmp(encoding, "A_IPCM", 6) && insert_pcm_as_lpcm)
|
||||
{
|
||||
encoding = "A_LPCM";
|
||||
@@ -1886,7 +1882,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
||||
else if (get_codecpar(stream)->codec_id == AV_CODEC_ID_AAC)
|
||||
{
|
||||
if (0 == strncmp(avContext->iformat->name, "mpegts", 6) ||
|
||||
0 == strncmp(avContext->iformat->name, "hls,", 4))
|
||||
0 == strncmp(avContext->iformat->name, "hls,", 4))
|
||||
{
|
||||
const char marker[] = "ADTS";
|
||||
track.aacbuflen = sizeof(marker) / sizeof(char);
|
||||
@@ -1962,10 +1958,10 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
||||
}
|
||||
*/
|
||||
}
|
||||
else if (get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV1
|
||||
|| get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV2
|
||||
|| get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAPRO
|
||||
|| get_codecpar(stream)->codec_id == AV_CODEC_ID_WMALOSSLESS) //if (get_codecpar(stream)->extradata_size > 0)
|
||||
else if (get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV1 ||
|
||||
get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV2 ||
|
||||
get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAPRO ||
|
||||
get_codecpar(stream)->codec_id == AV_CODEC_ID_WMALOSSLESS) //if (get_codecpar(stream)->extradata_size > 0)
|
||||
{
|
||||
ffmpeg_printf(10, "Create WMA ExtraData\n");
|
||||
uint16_t channels = get_codecpar(stream)->channels;
|
||||
@@ -2104,11 +2100,11 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
||||
{
|
||||
if (get_codecpar(stream)->codec_id != AV_CODEC_ID_SSA &&
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 3, 100)
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_ASS &&
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_ASS &&
|
||||
#endif
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_SUBRIP &&
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_TEXT &&
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_SRT)
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_SUBRIP &&
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_TEXT &&
|
||||
get_codecpar(stream)->codec_id != AV_CODEC_ID_SRT)
|
||||
{
|
||||
ffmpeg_printf(10, "subtitle with not supported codec codec_id[%u]\n", (uint32_t)get_codecpar(stream)->codec_id);
|
||||
}
|
||||
@@ -2510,7 +2506,7 @@ static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length)
|
||||
static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg)
|
||||
{
|
||||
ffmpeg_printf(10, "track %d\n", *arg);
|
||||
/* Hellmaster1024: nothing to do here!*/
|
||||
/* Hellmaster1024: nothing to do here! */
|
||||
int64_t sec = -5;
|
||||
context->playback->Command(context, PLAYBACK_SEEK, (void *)&sec);
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
@@ -2651,11 +2647,11 @@ static int32_t Command(void *_context, ContainerCmd_t command, void *argument)
|
||||
int ret = cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
ffmpeg_printf(50, "Command %d\n", command);
|
||||
if (command != CONTAINER_SET_BUFFER_SEEK_TIME &&
|
||||
command != CONTAINER_SET_BUFFER_SIZE &&
|
||||
command != CONTAINER_GET_BUFFER_SIZE &&
|
||||
command != CONTAINER_GET_BUFFER_STATUS &&
|
||||
command != CONTAINER_STOP_BUFFER &&
|
||||
command != CONTAINER_INIT && !avContextTab[0])
|
||||
command != CONTAINER_SET_BUFFER_SIZE &&
|
||||
command != CONTAINER_GET_BUFFER_SIZE &&
|
||||
command != CONTAINER_GET_BUFFER_STATUS &&
|
||||
command != CONTAINER_STOP_BUFFER &&
|
||||
command != CONTAINER_INIT && !avContextTab[0])
|
||||
{
|
||||
return cERR_CONTAINER_FFMPEG_ERR;
|
||||
}
|
||||
|
@@ -32,9 +32,9 @@ static int filter_packet(AVBitStreamFilterContext *bsf_ctx, AVCodecContext *enc_
|
||||
int ret;
|
||||
AVPacket new_pkt = *pkt;
|
||||
ret = av_bitstream_filter_filter(bsf_ctx, enc_ctx, NULL,
|
||||
&new_pkt.data, &new_pkt.size,
|
||||
pkt->data, pkt->size,
|
||||
pkt->flags & AV_PKT_FLAG_KEY);
|
||||
&new_pkt.data, &new_pkt.size,
|
||||
pkt->data, pkt->size,
|
||||
pkt->flags & AV_PKT_FLAG_KEY);
|
||||
if (ret == 0 && new_pkt.data != pkt->data)
|
||||
{
|
||||
if ((ret = av_copy_packet(&new_pkt, pkt)) < 0)
|
||||
@@ -47,15 +47,15 @@ static int filter_packet(AVBitStreamFilterContext *bsf_ctx, AVCodecContext *enc_
|
||||
pkt->side_data_elems = 0;
|
||||
wrapped_packet_unref(pkt);
|
||||
new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size,
|
||||
av_buffer_default_free, NULL, 0);
|
||||
av_buffer_default_free, NULL, 0);
|
||||
if (!new_pkt.buf)
|
||||
return -1;
|
||||
}
|
||||
if (ret < 0)
|
||||
{
|
||||
ffmpeg_err("Failed to filter bitstream with filter %s for stream %d with codec %s\n",
|
||||
bsf_ctx->filter->name, pkt->stream_index,
|
||||
avcodec_get_name(enc_ctx->codec_id));
|
||||
bsf_ctx->filter->name, pkt->stream_index,
|
||||
avcodec_get_name(enc_ctx->codec_id));
|
||||
return -1;
|
||||
}
|
||||
*pkt = new_pkt;
|
||||
|
154
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
154
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
@@ -97,8 +97,8 @@ typedef struct GetBitContext
|
||||
#endif
|
||||
|
||||
#define OPEN_READER_NOSIZE(name, gb) \
|
||||
unsigned int name ## _index = (gb)->index; \
|
||||
unsigned int av_unused name ## _cache
|
||||
unsigned int name ## _index = (gb)->index; \
|
||||
unsigned int av_unused name ## _cache
|
||||
|
||||
#define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb)
|
||||
#define BITS_AVAILABLE(name, gb) 1
|
||||
@@ -108,18 +108,18 @@ typedef struct GetBitContext
|
||||
# ifdef LONG_BITSTREAM_READER
|
||||
|
||||
# define UPDATE_CACHE_LE(name, gb) name ## _cache = \
|
||||
AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
|
||||
AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
|
||||
|
||||
# define UPDATE_CACHE_BE(name, gb) name ## _cache = \
|
||||
AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7))
|
||||
AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7))
|
||||
|
||||
#else
|
||||
|
||||
# define UPDATE_CACHE_LE(name, gb) name ## _cache = \
|
||||
AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
|
||||
AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
|
||||
|
||||
# define UPDATE_CACHE_BE(name, gb) name ## _cache = \
|
||||
AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7)
|
||||
AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -142,10 +142,10 @@ typedef struct GetBitContext
|
||||
#define BITS_LEFT(name, gb) ((int)((gb)->size_in_bits - name ## _index))
|
||||
|
||||
#define SKIP_BITS(name, gb, num) \
|
||||
do { \
|
||||
SKIP_CACHE(name, gb, num); \
|
||||
SKIP_COUNTER(name, gb, num); \
|
||||
} while (0)
|
||||
do { \
|
||||
SKIP_CACHE(name, gb, num); \
|
||||
SKIP_COUNTER(name, gb, num); \
|
||||
} while (0)
|
||||
|
||||
#define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num)
|
||||
|
||||
@@ -383,7 +383,7 @@ static inline int check_marker(void *logctx, GetBitContext *s, const char *msg)
|
||||
* @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
|
||||
*/
|
||||
static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
|
||||
int bit_size)
|
||||
int bit_size)
|
||||
{
|
||||
int buffer_size;
|
||||
int ret = 0;
|
||||
@@ -411,7 +411,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
|
||||
* @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
|
||||
*/
|
||||
static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
|
||||
int byte_size)
|
||||
int byte_size)
|
||||
{
|
||||
if (byte_size > INT_MAX / 8 || byte_size < 0)
|
||||
byte_size = -1;
|
||||
@@ -432,73 +432,73 @@ static inline const uint8_t *align_get_bits(GetBitContext *s)
|
||||
* is undefined.
|
||||
*/
|
||||
#define GET_VLC(code, name, gb, table, bits, max_depth) \
|
||||
do { \
|
||||
int n, nb_bits; \
|
||||
unsigned int index; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, bits); \
|
||||
code = table[index][0]; \
|
||||
n = table[index][1]; \
|
||||
\
|
||||
if (max_depth > 1 && n < 0) { \
|
||||
LAST_SKIP_BITS(name, gb, bits); \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
\
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + code; \
|
||||
code = table[index][0]; \
|
||||
n = table[index][1]; \
|
||||
if (max_depth > 2 && n < 0) { \
|
||||
LAST_SKIP_BITS(name, gb, nb_bits); \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
\
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + code; \
|
||||
code = table[index][0]; \
|
||||
n = table[index][1]; \
|
||||
} \
|
||||
} \
|
||||
SKIP_BITS(name, gb, n); \
|
||||
} while (0)
|
||||
do { \
|
||||
int n, nb_bits; \
|
||||
unsigned int index; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, bits); \
|
||||
code = table[index][0]; \
|
||||
n = table[index][1]; \
|
||||
\
|
||||
if (max_depth > 1 && n < 0) { \
|
||||
LAST_SKIP_BITS(name, gb, bits); \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
\
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + code; \
|
||||
code = table[index][0]; \
|
||||
n = table[index][1]; \
|
||||
if (max_depth > 2 && n < 0) { \
|
||||
LAST_SKIP_BITS(name, gb, nb_bits); \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
\
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + code; \
|
||||
code = table[index][0]; \
|
||||
n = table[index][1]; \
|
||||
} \
|
||||
} \
|
||||
SKIP_BITS(name, gb, n); \
|
||||
} while (0)
|
||||
|
||||
#define GET_RL_VLC(level, run, name, gb, table, bits, \
|
||||
max_depth, need_update) \
|
||||
do { \
|
||||
int n, nb_bits; \
|
||||
unsigned int index; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, bits); \
|
||||
level = table[index].level; \
|
||||
n = table[index].len; \
|
||||
\
|
||||
if (max_depth > 1 && n < 0) { \
|
||||
SKIP_BITS(name, gb, bits); \
|
||||
if (need_update) { \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
} \
|
||||
\
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + level; \
|
||||
level = table[index].level; \
|
||||
n = table[index].len; \
|
||||
if (max_depth > 2 && n < 0) { \
|
||||
LAST_SKIP_BITS(name, gb, nb_bits); \
|
||||
if (need_update) { \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
} \
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + level; \
|
||||
level = table[index].level; \
|
||||
n = table[index].len; \
|
||||
} \
|
||||
} \
|
||||
run = table[index].run; \
|
||||
SKIP_BITS(name, gb, n); \
|
||||
} while (0)
|
||||
max_depth, need_update) \
|
||||
do { \
|
||||
int n, nb_bits; \
|
||||
unsigned int index; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, bits); \
|
||||
level = table[index].level; \
|
||||
n = table[index].len; \
|
||||
\
|
||||
if (max_depth > 1 && n < 0) { \
|
||||
SKIP_BITS(name, gb, bits); \
|
||||
if (need_update) { \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
} \
|
||||
\
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + level; \
|
||||
level = table[index].level; \
|
||||
n = table[index].len; \
|
||||
if (max_depth > 2 && n < 0) { \
|
||||
LAST_SKIP_BITS(name, gb, nb_bits); \
|
||||
if (need_update) { \
|
||||
UPDATE_CACHE(name, gb); \
|
||||
} \
|
||||
nb_bits = -n; \
|
||||
\
|
||||
index = SHOW_UBITS(name, gb, nb_bits) + level; \
|
||||
level = table[index].level; \
|
||||
n = table[index].len; \
|
||||
} \
|
||||
} \
|
||||
run = table[index].run; \
|
||||
SKIP_BITS(name, gb, n); \
|
||||
} while (0)
|
||||
|
||||
static inline int decode012(GetBitContext *gb)
|
||||
{
|
||||
|
2
libeplayer3-arm/external/ffmpeg/mathops.h
vendored
2
libeplayer3-arm/external/ffmpeg/mathops.h
vendored
@@ -30,7 +30,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef NEG_SSR32
|
||||
# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
|
||||
# define NEG_SSR32(a,s) (((int32_t)(a))>>(32-(s)))
|
||||
#endif
|
||||
|
||||
#ifndef sign_extend
|
||||
|
2
libeplayer3-arm/external/ffmpeg/mpeg4audio.h
vendored
2
libeplayer3-arm/external/ffmpeg/mpeg4audio.h
vendored
@@ -54,7 +54,7 @@ extern const uint8_t ff_mpeg4audio_channels[8];
|
||||
* @return On error -1 is returned, on success AudioSpecificConfig bit index in extradata.
|
||||
*/
|
||||
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
||||
int bit_size, int sync_extension);
|
||||
int bit_size, int sync_extension);
|
||||
|
||||
enum AudioObjectType
|
||||
{
|
||||
|
6
libeplayer3-arm/external/ffmpeg/put_bits.h
vendored
6
libeplayer3-arm/external/ffmpeg/put_bits.h
vendored
@@ -47,7 +47,7 @@ typedef struct PutBitContext
|
||||
* @param buffer_size the size in bytes of buffer
|
||||
*/
|
||||
static inline void init_put_bits(PutBitContext *s, uint8_t *buffer,
|
||||
int buffer_size)
|
||||
int buffer_size)
|
||||
{
|
||||
if (buffer_size < 0)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ static inline void init_put_bits(PutBitContext *s, uint8_t *buffer,
|
||||
* must be larger than the previous size
|
||||
*/
|
||||
static inline void rebase_put_bits(PutBitContext *s, uint8_t *buffer,
|
||||
int buffer_size)
|
||||
int buffer_size)
|
||||
{
|
||||
av_assert0(8 * buffer_size > s->size_in_bits);
|
||||
s->buf_end = buffer + buffer_size;
|
||||
@@ -136,7 +136,7 @@ void avpriv_align_put_bits(PutBitContext *s);
|
||||
* @param terminate_string 0-terminates the written string if value is 1
|
||||
*/
|
||||
void avpriv_put_string(PutBitContext *pb, const char *string,
|
||||
int terminate_string);
|
||||
int terminate_string);
|
||||
|
||||
/**
|
||||
* Copy the content of src to the bitstream.
|
||||
|
@@ -36,8 +36,7 @@ void avpriv_align_put_bits(PutBitContext *s)
|
||||
put_bits(s, s->bit_left & 7, 0);
|
||||
}
|
||||
|
||||
void avpriv_put_string(PutBitContext *pb, const char *string,
|
||||
int terminate_string)
|
||||
void avpriv_put_string(PutBitContext *pb, const char *string, int terminate_string)
|
||||
{
|
||||
while (*string)
|
||||
{
|
||||
|
12
libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c
vendored
12
libeplayer3-arm/external/ffmpeg/src/mpeg4audio.c
vendored
@@ -72,11 +72,11 @@ static inline int get_sample_rate(GetBitContext *gb, int *index)
|
||||
{
|
||||
*index = get_bits(gb, 4);
|
||||
return *index == 0x0f ? get_bits(gb, 24) :
|
||||
avpriv_mpeg4audio_sample_rates[*index];
|
||||
avpriv_mpeg4audio_sample_rates[*index];
|
||||
}
|
||||
|
||||
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
||||
int bit_size, int sync_extension)
|
||||
int bit_size, int sync_extension)
|
||||
{
|
||||
GetBitContext gb;
|
||||
int specific_config_bitindex, ret;
|
||||
@@ -93,8 +93,8 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
||||
c->sbr = -1;
|
||||
c->ps = -1;
|
||||
if (c->object_type == AOT_SBR || (c->object_type == AOT_PS &&
|
||||
// check for W6132 Annex YYYY draft MP3onMP4
|
||||
!(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F))))
|
||||
// check for W6132 Annex YYYY draft MP3onMP4
|
||||
!(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F))))
|
||||
{
|
||||
if (c->object_type == AOT_PS)
|
||||
c->ps = 1;
|
||||
@@ -152,8 +152,8 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
||||
}
|
||||
|
||||
static av_always_inline unsigned int copy_bits(PutBitContext *pb,
|
||||
GetBitContext *gb,
|
||||
int bits)
|
||||
GetBitContext *gb,
|
||||
int bits)
|
||||
{
|
||||
unsigned int el = get_bits(gb, bits);
|
||||
put_bits(pb, bits, el);
|
||||
|
@@ -129,10 +129,10 @@ static int write_pad_not_coded_frames(flv2mpeg4_CTX *pub_ctx, CONVCTX *c, BW *bw
|
||||
flash_bw(bw);
|
||||
// write frame
|
||||
if (pub_ctx->write_packet_cb(pub_ctx->usr_data,
|
||||
0,
|
||||
0,//c->frame,
|
||||
bw->buf,
|
||||
bw->pos) < 0)
|
||||
0,
|
||||
0,//c->frame,
|
||||
bw->buf,
|
||||
bw->pos) < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@@ -184,10 +184,10 @@ static int write_m4v_picture_frame(flv2mpeg4_CTX *pub_ctx, CONVCTX *c, BR *br, B
|
||||
flash_bw(bw);
|
||||
// write frame
|
||||
if (pub_ctx->write_packet_cb(pub_ctx->usr_data,
|
||||
vop.picture_type == M4V_I_TYPE,
|
||||
0,//c->frame,
|
||||
bw->buf,
|
||||
bw->pos) < 0)
|
||||
vop.picture_type == M4V_I_TYPE,
|
||||
0,//c->frame,
|
||||
bw->buf,
|
||||
bw->pos) < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
@@ -109,8 +109,8 @@ static void __inline encode_escape_3(BW *p, int last, int run, int level)
|
||||
{
|
||||
#if 0
|
||||
put_bits(p,
|
||||
7 + 2 + 1 + 6 + 1 + 12 + 1, //30bit
|
||||
(3 << 23) + (3 << 21) + (last << 20) + (run << 14) + (1 << 13) + (((level - 64) & 0xfff) << 1) + 1);
|
||||
7 + 2 + 1 + 6 + 1 + 12 + 1, //30bit
|
||||
(3 << 23) + (3 << 21) + (last << 20) + (run << 14) + (1 << 13) + (((level - 64) & 0xfff) << 1) + 1);
|
||||
#else
|
||||
put_bits(p, 7, 3); // escape
|
||||
put_bits(p, 2, 3); // escape3
|
||||
|
@@ -25,7 +25,7 @@
|
||||
static inline int HasADTSHeader(uint8_t *data, int size)
|
||||
{
|
||||
if (size >= AAC_HEADER_LENGTH && 0xFF == data[0] && 0xF0 == 0xF0 & data[1] &&
|
||||
size == ((data[3] & 0x3) << 11 | data[4] << 3 | data[5] >> 5))
|
||||
size == ((data[3] & 0x3) << 11 | data[4] << 3 | data[5] >> 5))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef COMMON_H_
|
||||
#define COMMON_H_
|
||||
|
||||
#include<stdint.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "container.h"
|
||||
#include "output.h"
|
||||
|
@@ -86,7 +86,6 @@ typedef struct TrackDescription_s
|
||||
int32_t aspect_ratio_num;
|
||||
int32_t aspect_ratio_den;
|
||||
int progressive;
|
||||
|
||||
} TrackDescription_t;
|
||||
|
||||
typedef struct Manager_s
|
||||
@@ -94,7 +93,6 @@ typedef struct Manager_s
|
||||
char *Name;
|
||||
int (* Command)(/*Context_t*/void *, ManagerCmd_t, void *);
|
||||
char **Capabilities;
|
||||
|
||||
} Manager_t;
|
||||
|
||||
typedef struct ManagerHandler_s
|
||||
|
@@ -15,16 +15,16 @@
|
||||
|
||||
typedef struct BitPacker_s
|
||||
{
|
||||
uint8_t *Ptr; /* write pointer */
|
||||
uint32_t BitBuffer; /* bitreader shifter */
|
||||
int32_t Remaining; /* number of remaining in the shifter */
|
||||
uint8_t *Ptr; /* write pointer */
|
||||
uint32_t BitBuffer; /* bitreader shifter */
|
||||
int32_t Remaining; /* number of remaining in the shifter */
|
||||
} BitPacker_t;
|
||||
|
||||
/* ***************************** */
|
||||
/* Makros/Constants */
|
||||
/* ***************************** */
|
||||
|
||||
#define INVALID_PTS_VALUE 0x200000000ull
|
||||
#define INVALID_PTS_VALUE 0x200000000ull
|
||||
|
||||
/* ***************************** */
|
||||
/* Prototypes */
|
||||
@@ -96,16 +96,16 @@ static inline int32_t IsDreambox()
|
||||
static inline uint32_t ReadUint32(uint8_t *buffer)
|
||||
{
|
||||
uint32_t num = (uint32_t)buffer[0] << 24 |
|
||||
(uint32_t)buffer[1] << 16 |
|
||||
(uint32_t)buffer[2] << 8 |
|
||||
(uint32_t)buffer[3];
|
||||
(uint32_t)buffer[1] << 16 |
|
||||
(uint32_t)buffer[2] << 8 |
|
||||
(uint32_t)buffer[3];
|
||||
return num;
|
||||
}
|
||||
|
||||
static inline uint16_t ReadUInt16(uint8_t *buffer)
|
||||
{
|
||||
uint16_t num = (uint16_t)buffer[0] << 8 |
|
||||
(uint16_t)buffer[1];
|
||||
(uint16_t)buffer[1];
|
||||
return num;
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define OUTPUT_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -69,7 +70,6 @@ typedef struct Output_s
|
||||
int32_t (* Command)(/*Context_t*/void *, OutputCmd_t, void *);
|
||||
int32_t (* Write)(/*Context_t*/void *, void *privateData);
|
||||
char **Capabilities;
|
||||
|
||||
} Output_t;
|
||||
|
||||
extern Output_t LinuxDvbOutput;
|
||||
|
@@ -3,7 +3,28 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_SEEK_ABS, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT, PLAYBACK_METADATA} PlaybackCmd_t;
|
||||
typedef enum {
|
||||
PLAYBACK_OPEN,
|
||||
PLAYBACK_CLOSE,
|
||||
PLAYBACK_PLAY,
|
||||
PLAYBACK_STOP,
|
||||
PLAYBACK_PAUSE,
|
||||
PLAYBACK_CONTINUE,
|
||||
PLAYBACK_FLUSH,
|
||||
PLAYBACK_TERM,
|
||||
PLAYBACK_FASTFORWARD,
|
||||
PLAYBACK_SEEK,
|
||||
PLAYBACK_SEEK_ABS,
|
||||
PLAYBACK_PTS,
|
||||
PLAYBACK_LENGTH,
|
||||
PLAYBACK_SWITCH_AUDIO,
|
||||
PLAYBACK_SWITCH_SUBTITLE,
|
||||
PLAYBACK_INFO,
|
||||
PLAYBACK_SLOWMOTION,
|
||||
PLAYBACK_FASTBACKWARD,
|
||||
PLAYBACK_GET_FRAME_COUNT,
|
||||
PLAYBACK_METADATA
|
||||
} PlaybackCmd_t;
|
||||
|
||||
typedef struct PlaybackHandler_s
|
||||
{
|
||||
|
@@ -119,8 +119,7 @@ static void *TermThreadFun(void *arg)
|
||||
FD_SET(g_pfd[0], &readfds);
|
||||
FD_SET(fd, &readfds);
|
||||
nfds = fd > g_pfd[0] ? fd + 1 : g_pfd[0] + 1;
|
||||
while (select(nfds, &readfds, NULL, NULL, NULL) == -1
|
||||
&& errno == EINTR)
|
||||
while (select(nfds, &readfds, NULL, NULL, NULL) == -1 && errno == EINTR)
|
||||
{
|
||||
/* Restart if interrupted by signal */
|
||||
continue;
|
||||
@@ -128,7 +127,7 @@ static void *TermThreadFun(void *arg)
|
||||
if (FD_ISSET(fd, &readfds))
|
||||
{
|
||||
/*
|
||||
if ( (cl = accept(fd, NULL, NULL)) == -1)
|
||||
if ((cl = accept(fd, NULL, NULL)) == -1)
|
||||
{
|
||||
perror("TermThreadFun accept error");
|
||||
goto finish;
|
||||
@@ -404,7 +403,7 @@ static int HandleTracks(const Manager_t *ptrManager, const PlaybackCmd_t playbac
|
||||
else // video
|
||||
{
|
||||
fprintf(stderr, "{\"%c_%c\":{\"id\":%d,\"e\":\"%s\",\"n\":\"%s\",\"w\":%d,\"h\":%d,\"f\":%u,\"p\":%d,\"an\":%d,\"ad\":%d}}\n", \
|
||||
argvBuff[0], argvBuff[1], track->Id, track->Encoding, track->Name, track->width, track->height, track->frame_rate, track->progressive, track->aspect_ratio_num, track->aspect_ratio_den);
|
||||
argvBuff[0], argvBuff[1], track->Id, track->Encoding, track->Name, track->width, track->height, track->frame_rate, track->progressive, track->aspect_ratio_num, track->aspect_ratio_den);
|
||||
}
|
||||
free(track->Encoding);
|
||||
free(track->Name);
|
||||
@@ -475,6 +474,7 @@ static int HandleTracks(const Manager_t *ptrManager, const PlaybackCmd_t playbac
|
||||
return commandRetVal;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void UpdateVideoTrack()
|
||||
{
|
||||
HandleTracks(g_player->manager->video, (PlaybackCmd_t) - 1, "vc");
|
||||
@@ -932,10 +932,10 @@ int main(int argc, char *argv[])
|
||||
if (ptrP)
|
||||
{
|
||||
fprintf(stderr, "{\"PLAYBACK_INFO\":{ \"isPlaying\":%s, \"isPaused\":%s, \"isForwarding\":%s, \"isSeeking\":%s, \"isCreationPhase\":%s,", \
|
||||
DUMP_BOOL(ptrP->isPlaying), DUMP_BOOL(ptrP->isPaused), DUMP_BOOL(ptrP->isForwarding), DUMP_BOOL(ptrP->isSeeking), DUMP_BOOL(ptrP->isCreationPhase));
|
||||
DUMP_BOOL(ptrP->isPlaying), DUMP_BOOL(ptrP->isPaused), DUMP_BOOL(ptrP->isForwarding), DUMP_BOOL(ptrP->isSeeking), DUMP_BOOL(ptrP->isCreationPhase));
|
||||
fprintf(stderr, "\"BackWard\":%d, \"SlowMotion\":%d, \"Speed\":%d, \"AVSync\":%d,", ptrP->BackWard, ptrP->SlowMotion, ptrP->Speed, ptrP->AVSync);
|
||||
fprintf(stderr, " \"isVideo\":%s, \"isAudio\":%s, \"isSubtitle\":%s, \"isDvbSubtitle\":%s, \"isTeletext\":%s, \"mayWriteToFramebuffer\":%s, \"abortRequested\":%s }}\n", \
|
||||
DUMP_BOOL(ptrP->isVideo), DUMP_BOOL(ptrP->isAudio), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(ptrP->abortRequested));
|
||||
DUMP_BOOL(ptrP->isVideo), DUMP_BOOL(ptrP->isAudio), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(0), DUMP_BOOL(ptrP->abortRequested));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -253,9 +253,9 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
if (track)
|
||||
{
|
||||
memset(track, 0, sizeof(TrackDescription_t));
|
||||
track->Id = Tracks[CurrentTrack].Id;
|
||||
track->Name = strdup(Tracks[CurrentTrack].Name);
|
||||
track->Encoding = strdup(Tracks[CurrentTrack].Encoding);
|
||||
track->Id = Tracks[CurrentTrack].Id;
|
||||
track->Name = strdup(Tracks[CurrentTrack].Name);
|
||||
track->Encoding = strdup(Tracks[CurrentTrack].Encoding);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -183,7 +183,7 @@ static int ManagerDel(Context_t *context)
|
||||
|
||||
static int Command(void *_context, ManagerCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_VIDEO_MGR_NO_ERROR;
|
||||
video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
|
||||
switch (command)
|
||||
|
@@ -426,7 +426,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
||||
// linuxdvb_printf(50, "\n");
|
||||
// if (ioctl( videofd, VIDEO_DISCONTINUITY, (void*) dis_type) == -1)
|
||||
// if (ioctl(videofd, VIDEO_DISCONTINUITY, (void*) dis_type) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("VIDEO_DISCONTINUITY: %s\n", strerror(errno));
|
||||
@@ -475,7 +475,7 @@ int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
|
||||
// unsigned char video = !strcmp("video", type);
|
||||
// unsigned char audio = !strcmp("audio", type);
|
||||
// linuxdvb_printf(10, "v%d a%d\n", video, audio);
|
||||
// if ( (video && videofd != -1) || (audio && audiofd != -1) ) {
|
||||
// if ((video && videofd != -1) || (audio && audiofd != -1)) {
|
||||
// getLinuxDVBMutex(FILENAME, __FUNCTION__,__LINE__);
|
||||
// if (video && videofd != -1) {
|
||||
// if (ioctl(videofd, VIDEO_FLUSH, NULL) == -1)
|
||||
@@ -723,7 +723,7 @@ int LinuxDvbSwitch(Context_t *context, char *type)
|
||||
if (writer == NULL)
|
||||
{
|
||||
linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding);
|
||||
// if (ioctl( audiofd, AUDIO_SET_BYPASS_MODE, (void*) AUDIO_ENCODING_MP3) == -1)
|
||||
// if (ioctl(audiofd, AUDIO_SET_BYPASS_MODE, (void*) AUDIO_ENCODING_MP3) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("AUDIO_SET_BYPASS_MODE: %s\n", strerror(errno));
|
||||
@@ -771,7 +771,7 @@ int LinuxDvbSwitch(Context_t *context, char *type)
|
||||
if (writer == NULL)
|
||||
{
|
||||
linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding);
|
||||
// if (ioctl( videofd, VIDEO_SET_STREAMTYPE, (void*) VIDEO_ENCODING_AUTO) == -1)
|
||||
// if (ioctl(videofd, VIDEO_SET_STREAMTYPE, (void*) VIDEO_ENCODING_AUTO) == -1)
|
||||
// {
|
||||
// linuxdvb_err("ioctl failed with errno %d\n", errno);
|
||||
// linuxdvb_err("VIDEO_SET_STREAMTYPE: %s\n", strerror(errno));
|
||||
@@ -825,7 +825,7 @@ static int Write(void *_context, void *_out)
|
||||
video = !strcmp("video", out->type);
|
||||
audio = !strcmp("audio", out->type);
|
||||
linuxdvb_printf(20, "DataLength=%u PrivateLength=%u Pts=%llu FrameRate=%f\n",
|
||||
out->len, out->extralen, out->pts, out->frameRate);
|
||||
out->len, out->extralen, out->pts, out->frameRate);
|
||||
linuxdvb_printf(20, "v%d a%d\n", video, audio);
|
||||
if (video)
|
||||
{
|
||||
|
@@ -59,7 +59,7 @@ static const char FILENAME[] = __FILE__;
|
||||
|
||||
#ifdef LINUXDVB_DEBUG
|
||||
#define linuxdvb_printf(level, fmt, x...) do { \
|
||||
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0)
|
||||
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
|
||||
#else
|
||||
#define linuxdvb_printf(x...)
|
||||
#endif
|
||||
@@ -828,7 +828,7 @@ static int Write(void *_context, void *_out)
|
||||
video = !strcmp("video", out->type);
|
||||
audio = !strcmp("audio", out->type);
|
||||
linuxdvb_printf(20, "DataLength=%u PrivateLength=%u Pts=%llu FrameRate=%f\n",
|
||||
out->len, out->extralen, out->pts, out->frameRate);
|
||||
out->len, out->extralen, out->pts, out->frameRate);
|
||||
linuxdvb_printf(20, "v%d a%d\n", video, audio);
|
||||
if (video)
|
||||
{
|
||||
|
@@ -149,7 +149,7 @@ static void OutputDel(Context_t *context, char *port)
|
||||
|
||||
static int Command(void *_context, OutputCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_OUTPUT_NO_ERROR;
|
||||
output_printf(10, "%s::%s Command %d\n", __FILE__, __FUNCTION__, command);
|
||||
switch (command)
|
||||
|
@@ -190,7 +190,7 @@ static int Flush()
|
||||
|
||||
static int Write(void *_context, void *data)
|
||||
{
|
||||
Context_t *context = (Context_t *)_context;
|
||||
Context_t *context = (Context_t *)_context;
|
||||
char *Encoding = NULL;
|
||||
SubtitleOut_t *out = NULL;
|
||||
int32_t curtrackid = -1;
|
||||
@@ -224,7 +224,7 @@ static int Write(void *_context, void *data)
|
||||
else
|
||||
{
|
||||
subtitle_err("unknown encoding %s\n", Encoding);
|
||||
return cERR_SUBTITLE_ERROR;
|
||||
return cERR_SUBTITLE_ERROR;
|
||||
}
|
||||
subtitle_printf(10, "<\n");
|
||||
return cERR_SUBTITLE_NO_ERROR;
|
||||
@@ -259,7 +259,7 @@ static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
|
||||
|
||||
static int Command(void *_context, OutputCmd_t command, void *argument)
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_SUBTITLE_NO_ERROR;
|
||||
subtitle_printf(50, "%d\n", command);
|
||||
switch (command)
|
||||
|
@@ -182,7 +182,7 @@ static int _writeData(void *_call, int type)
|
||||
else // check LOAS header
|
||||
{
|
||||
if (!(call->len > 2 && call->data[0] == 0x56 && (call->data[1] >> 4) == 0xe &&
|
||||
(AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len))
|
||||
(AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len))
|
||||
{
|
||||
aac_err("parsing Data with wrong latm header. ignoring...\n");
|
||||
return 0;
|
||||
@@ -193,9 +193,9 @@ static int _writeData(void *_call, int type)
|
||||
unsigned int HeaderLength = InsertPesHeader(PesHeader, call->len, MPEG_AUDIO_PES_START_CODE, call->Pts, 0);
|
||||
struct iovec iov[2];
|
||||
iov[0].iov_base = PesHeader;
|
||||
iov[0].iov_len = HeaderLength;
|
||||
iov[0].iov_len = HeaderLength;
|
||||
iov[1].iov_base = call->data;
|
||||
iov[1].iov_len = call->len;
|
||||
iov[1].iov_len = call->len;
|
||||
return writev_with_retry(call->fd, iov, 2);
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ static int writeDataADTS(void *_call)
|
||||
return 0;
|
||||
}
|
||||
if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) ||
|
||||
HasADTSHeader(call->data, call->len))
|
||||
HasADTSHeader(call->data, call->len))
|
||||
{
|
||||
return _writeData(_call, 0);
|
||||
}
|
||||
@@ -294,7 +294,7 @@ static int writeDataLATM(void *_call)
|
||||
if (ret)
|
||||
{
|
||||
printf("%02x %02x %02x %02x %02x %02x %02x %02x\n", (int)call->data[0], (int)call->data[1], (int)call->data[2], (int)call->data[3], \
|
||||
(int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]);
|
||||
(int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]);
|
||||
aac_err("latm_decode_extradata failed. ignoring...\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -99,7 +99,7 @@ static int writeData(void *_call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
ac3_printf(10, "\n");
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
if (call == NULL)
|
||||
{
|
||||
ac3_err("call data is NULL...\n");
|
||||
@@ -118,7 +118,7 @@ static int writeData(void *_call)
|
||||
}
|
||||
struct iovec iov[3];
|
||||
iov[0].iov_base = PesHeader;
|
||||
iov[0].iov_len = InsertPesHeader(PesHeader, call->len, MPEG_AUDIO_PES_START_CODE, call->Pts, 0); //+ sizeof(AC3_SYNC_HEADER)
|
||||
iov[0].iov_len = InsertPesHeader(PesHeader, call->len, MPEG_AUDIO_PES_START_CODE, call->Pts, 0); //+ sizeof(AC3_SYNC_HEADER)
|
||||
//PesHeader[6] = 0x81;
|
||||
//PesHeader[7] = 0x80;
|
||||
//PesHeader[8] = 0x09;
|
||||
|
@@ -106,6 +106,7 @@ static uint8_t brcm_divx311_sequence_header[] =
|
||||
/* ***************************** */
|
||||
/* MISC Functions */
|
||||
/* ***************************** */
|
||||
|
||||
static int reset()
|
||||
{
|
||||
initialHeader = 1;
|
||||
@@ -146,11 +147,11 @@ static int writeData(void *_call)
|
||||
data += 38;
|
||||
data[0] = B_GET_BITS(width, 11, 4);
|
||||
data[1] = B_SET_BITS("width [3..0]", B_GET_BITS(width, 3, 0), 7, 4) |
|
||||
B_SET_BITS("'10'", 0x02, 3, 2) |
|
||||
B_SET_BITS("height [11..10]", B_GET_BITS(height, 11, 10), 1, 0);
|
||||
B_SET_BITS("'10'", 0x02, 3, 2) |
|
||||
B_SET_BITS("height [11..10]", B_GET_BITS(height, 11, 10), 1, 0);
|
||||
data[2] = B_GET_BITS(height, 9, 2);
|
||||
data[3] = B_SET_BITS("height [1.0]", B_GET_BITS(height, 1, 0), 7, 6) |
|
||||
B_SET_BITS("'100000'", 0x20, 5, 0);
|
||||
B_SET_BITS("'100000'", 0x20, 5, 0);
|
||||
iov[ic].iov_base = brcm_divx311_sequence_header;
|
||||
iov[ic++].iov_len = sizeof(brcm_divx311_sequence_header);
|
||||
}
|
||||
|
@@ -69,6 +69,7 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x);
|
||||
#else
|
||||
#define h263_err(fmt, x...)
|
||||
#endif
|
||||
|
||||
/* ***************************** */
|
||||
/* Types */
|
||||
/* ***************************** */
|
||||
|
@@ -72,7 +72,7 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x);
|
||||
#define h264_err(fmt, x...)
|
||||
#endif
|
||||
|
||||
#define IOVEC_SIZE 128
|
||||
#define IOVEC_SIZE 128
|
||||
|
||||
/* ***************************** */
|
||||
/* Types */
|
||||
@@ -314,8 +314,8 @@ static int writeData(void *_call)
|
||||
}
|
||||
/* AnnexA */
|
||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
{
|
||||
uint32_t PacketLength = 0;
|
||||
uint32_t FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE;
|
||||
|
@@ -198,7 +198,7 @@ static int writeData(void *_call)
|
||||
h264_err("file pointer < 0. ignoring ...\n");
|
||||
return 0;
|
||||
}
|
||||
if (call->InfoFlags & 0x1) // TS container
|
||||
if (call->InfoFlags & 0x1) // TS container
|
||||
{
|
||||
h264_printf(10, "H265 simple inject method!\n");
|
||||
uint32_t PacketLength = 0;
|
||||
|
@@ -266,8 +266,7 @@ static int32_t writeData(void *_call)
|
||||
iov[1].iov_len = fixed_buffersize;
|
||||
writev_with_retry(call->fd, iov, 2);
|
||||
fixed_buffertimestamp += fixed_bufferduration;
|
||||
int g_fd_dump = open("/hdd/lpcm/ffmpeg.pes", O_CREAT |
|
||||
O_RDWR | O_APPEND, S_IRUSR | S_IWUSR);
|
||||
int g_fd_dump = open("/hdd/lpcm/ffmpeg.pes", O_CREAT | O_RDWR | O_APPEND, S_IRUSR | S_IWUSR);
|
||||
writev_with_retry(g_fd_dump, iov, 2);
|
||||
close(g_fd_dump);
|
||||
}
|
||||
|
@@ -100,6 +100,7 @@ static video_codec_data_t videocodecdata = {0, 0};
|
||||
/* ***************************** */
|
||||
/* MISC Functions */
|
||||
/* ***************************** */
|
||||
|
||||
static int reset()
|
||||
{
|
||||
initialHeader = 1;
|
||||
@@ -153,8 +154,8 @@ static int writeData(void *_call)
|
||||
}
|
||||
}
|
||||
uint8_t needFrameStartCode = 0;
|
||||
if (sizeof(Vc1FrameStartCode) >= call->len
|
||||
|| memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
||||
if (sizeof(Vc1FrameStartCode) >= call->len ||
|
||||
memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
||||
{
|
||||
needFrameStartCode = 1;
|
||||
PacketLength += sizeof(Vc1FrameStartCode);
|
||||
|
@@ -98,6 +98,7 @@ static video_codec_data_t videocodecdata = {0, 0};
|
||||
/* ***************************** */
|
||||
/* MISC Functions */
|
||||
/* ***************************** */
|
||||
|
||||
static int reset()
|
||||
{
|
||||
initialHeader = 1;
|
||||
@@ -159,8 +160,8 @@ static int writeData(void *_call)
|
||||
}
|
||||
}
|
||||
uint8_t needFrameStartCode = 0;
|
||||
if (sizeof(Vc1FrameStartCode) >= call->len
|
||||
|| memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
||||
if (sizeof(Vc1FrameStartCode) >= call->len ||
|
||||
memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
||||
{
|
||||
needFrameStartCode = 1;
|
||||
PacketLength += sizeof(Vc1FrameStartCode);
|
||||
|
@@ -99,6 +99,7 @@ static Writer_t *AvailableWriter[] =
|
||||
/* ***************************** */
|
||||
/* Functions */
|
||||
/* ***************************** */
|
||||
|
||||
ssize_t write_with_retry(int fd, const void *buf, size_t size)
|
||||
{
|
||||
ssize_t ret;
|
||||
|
@@ -180,7 +180,7 @@ static int _writeData(void *_call, int type)
|
||||
else // check LOAS header
|
||||
{
|
||||
if (!(call->len > 2 && call->data[0] == 0x56 && (call->data[1] >> 4) == 0xe &&
|
||||
(AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len))
|
||||
(AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len))
|
||||
{
|
||||
aac_err("parsing Data with wrong latm header. ignoring...\n");
|
||||
return 0;
|
||||
@@ -217,7 +217,7 @@ static int writeDataADTS(void *_call)
|
||||
return 0;
|
||||
}
|
||||
if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) ||
|
||||
HasADTSHeader(call->data, call->len))
|
||||
HasADTSHeader(call->data, call->len))
|
||||
{
|
||||
return _writeData(_call, 0);
|
||||
}
|
||||
@@ -291,7 +291,7 @@ static int writeDataLATM(void *_call)
|
||||
if (ret)
|
||||
{
|
||||
printf("%02x %02x %02x %02x %02x %02x %02x %02x\n", (int)call->data[0], (int)call->data[1], (int)call->data[2], (int)call->data[3], \
|
||||
(int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]);
|
||||
(int)call->data[4], (int)call->data[5], (int)call->data[6], (int)call->data[7]);
|
||||
aac_err("latm_decode_extradata failed. ignoring...\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -52,6 +52,7 @@
|
||||
/* ***************************** */
|
||||
/* Makros/Constants */
|
||||
/* ***************************** */
|
||||
|
||||
#ifdef SAM_WITH_DEBUG
|
||||
#define H264_DEBUG
|
||||
#else
|
||||
@@ -232,8 +233,8 @@ static int32_t writeData(void *_call)
|
||||
}
|
||||
/* AnnexA */
|
||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
{
|
||||
uint32_t PacketLength = 0;
|
||||
uint32_t FakeStartCode = /*(call->Version << 8) | */PES_VERSION_FAKE_START_CODE;
|
||||
@@ -401,7 +402,7 @@ static int32_t writeData(void *_call)
|
||||
if (NalStart + NalLength > SampleSize)
|
||||
{
|
||||
h264_printf(20, "nal length past end of buffer - size %u frame offset %u left %u\n",
|
||||
NalLength, NalStart, SampleSize - NalStart);
|
||||
NalLength, NalStart, SampleSize - NalStart);
|
||||
NalStart = SampleSize;
|
||||
}
|
||||
else
|
||||
|
@@ -120,7 +120,7 @@ static int writeData(void *_call)
|
||||
while (Position < call->len)
|
||||
{
|
||||
int32_t PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ?
|
||||
(call->len - Position) : MAX_PES_PACKET_SIZE;
|
||||
(call->len - Position) : MAX_PES_PACKET_SIZE;
|
||||
int32_t Remaining = call->len - Position - PacketLength;
|
||||
mpeg2_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position);
|
||||
struct iovec iov[2];
|
||||
|
@@ -119,11 +119,11 @@ static uint32_t breakBufferFillSize = 0;
|
||||
static int32_t prepareClipPlay(int32_t uNoOfChannels, int32_t uSampleRate, int32_t uBitsPerSample, uint8_t bLittleEndian __attribute__((unused)))
|
||||
{
|
||||
printf("rate: %d ch: %d bits: %d (%d bps)\n",
|
||||
uSampleRate/*Format->dwSamplesPerSec*/,
|
||||
uNoOfChannels/*Format->wChannels*/,
|
||||
uBitsPerSample/*Format->wBitsPerSample*/,
|
||||
(uBitsPerSample/*Format->wBitsPerSample*/ / 8)
|
||||
);
|
||||
uSampleRate/*Format->dwSamplesPerSec*/,
|
||||
uNoOfChannels/*Format->wChannels*/,
|
||||
uBitsPerSample/*Format->wBitsPerSample*/,
|
||||
(uBitsPerSample/*Format->wBitsPerSample*/ / 8)
|
||||
);
|
||||
SubFrameLen = 0;
|
||||
SubFramesPerPES = 0;
|
||||
breakBufferFillSize = 0;
|
||||
|
@@ -51,15 +51,15 @@
|
||||
/* Makros/Constants */
|
||||
/* ***************************** */
|
||||
|
||||
#define WMV3_PRIVATE_DATA_LENGTH 4
|
||||
#define WMV3_PRIVATE_DATA_LENGTH 4
|
||||
|
||||
#define METADATA_STRUCT_A_START 12
|
||||
#define METADATA_STRUCT_B_START 24
|
||||
#define METADATA_STRUCT_B_FRAMERATE_START 32
|
||||
#define METADATA_STRUCT_C_START 8
|
||||
#define METADATA_STRUCT_A_START 12
|
||||
#define METADATA_STRUCT_B_START 24
|
||||
#define METADATA_STRUCT_B_FRAMERATE_START 32
|
||||
#define METADATA_STRUCT_C_START 8
|
||||
|
||||
#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80
|
||||
#define VC1_FRAME_START_CODE 0x0d
|
||||
#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80
|
||||
#define VC1_FRAME_START_CODE 0x0d
|
||||
|
||||
#ifdef SAM_WITH_DEBUG
|
||||
#define VC1_DEBUG
|
||||
@@ -87,9 +87,9 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x);
|
||||
/* Types */
|
||||
/* ***************************** */
|
||||
|
||||
static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE};
|
||||
static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE};
|
||||
|
||||
static const unsigned char Metadata[] =
|
||||
static const unsigned char Metadata[] =
|
||||
{
|
||||
0x00, 0x00, 0x00, 0xc5,
|
||||
0x04, 0x00, 0x00, 0x00,
|
||||
@@ -103,7 +103,7 @@ static const unsigned char Metadata[] =
|
||||
};
|
||||
|
||||
/* ***************************** */
|
||||
/* Varaibles */
|
||||
/* Variables */
|
||||
/* ***************************** */
|
||||
|
||||
static int initialHeader = 1;
|
||||
@@ -199,7 +199,7 @@ static int writeData(void *_call)
|
||||
while (Position < call->len)
|
||||
{
|
||||
int32_t PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ?
|
||||
(call->len - Position) : MAX_PES_PACKET_SIZE;
|
||||
(call->len - Position) : MAX_PES_PACKET_SIZE;
|
||||
int32_t Remaining = call->len - Position - PacketLength;
|
||||
vc1_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position);
|
||||
uint8_t PesHeader[PES_MAX_HEADER_SIZE];
|
||||
|
@@ -51,7 +51,7 @@
|
||||
/* Makros/Constants */
|
||||
/* ***************************** */
|
||||
|
||||
#define WMV3_PRIVATE_DATA_LENGTH 4
|
||||
#define WMV3_PRIVATE_DATA_LENGTH 4
|
||||
|
||||
#define METADATA_STRUCT_A_START 12
|
||||
#define METADATA_STRUCT_B_START 24
|
||||
@@ -149,7 +149,7 @@ static int writeData(void *_call)
|
||||
wmv_printf(10, "VideoPts %lld\n", call->Pts);
|
||||
wmv_printf(10, "Got Private Size %d\n", call->private_size);
|
||||
memcpy(private_data.privateData, call->private_data,
|
||||
call->private_size > WMV3_PRIVATE_DATA_LENGTH ? WMV3_PRIVATE_DATA_LENGTH : call->private_size);
|
||||
call->private_size > WMV3_PRIVATE_DATA_LENGTH ? WMV3_PRIVATE_DATA_LENGTH : call->private_size);
|
||||
private_data.width = call->Width;
|
||||
private_data.height = call->Height;
|
||||
private_data.framerate = call->FrameRate;
|
||||
@@ -185,7 +185,7 @@ static int writeData(void *_call)
|
||||
*PesPtr++ = (crazyFramerate >> 16) & 0xff;
|
||||
*PesPtr++ = crazyFramerate >> 24;
|
||||
MetadataLength = PesPtr - &PesPacket[PES_MIN_HEADER_SIZE];
|
||||
int HeaderLength = InsertPesHeader(PesPacket, MetadataLength, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0);
|
||||
int HeaderLength = InsertPesHeader(PesPacket, MetadataLength, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0);
|
||||
len = write(call->fd, PesPacket, HeaderLength + MetadataLength);
|
||||
initialHeader = 0;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ static int writeData(void *_call)
|
||||
while (Position < call->len)
|
||||
{
|
||||
int PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ?
|
||||
(call->len - Position) : MAX_PES_PACKET_SIZE;
|
||||
(call->len - Position) : MAX_PES_PACKET_SIZE;
|
||||
int Remaining = call->len - Position - PacketLength;
|
||||
wmv_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position);
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
|
||||
@@ -207,11 +207,10 @@ static int writeData(void *_call)
|
||||
{
|
||||
unsigned int PesLength;
|
||||
unsigned int PrivateHeaderLength;
|
||||
PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength],
|
||||
call->len);
|
||||
PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], call->len);
|
||||
/* Update PesLength */
|
||||
PesLength = PesHeader[PES_LENGTH_BYTE_0] +
|
||||
(PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength;
|
||||
(PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength;
|
||||
PesHeader[PES_LENGTH_BYTE_0] = PesLength & 0xff;
|
||||
PesHeader[PES_LENGTH_BYTE_1] = (PesLength >> 8) & 0xff;
|
||||
PesHeader[PES_HEADER_DATA_LENGTH_BYTE] += PrivateHeaderLength;
|
||||
|
@@ -175,9 +175,9 @@ static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles)
|
||||
return cERR_PLAYBACK_ERROR;
|
||||
}
|
||||
pFiles->szFirstFile = context->playback->uri;
|
||||
if ((context->container->Command(context, CONTAINER_ADD, extension) < 0)
|
||||
|| (!context->container->selectedContainer)
|
||||
|| (context->container->selectedContainer->Command(context, CONTAINER_INIT, pFiles) < 0))
|
||||
if ((context->container->Command(context, CONTAINER_ADD, extension) < 0) ||
|
||||
(!context->container->selectedContainer) ||
|
||||
(context->container->selectedContainer->Command(context, CONTAINER_INIT, pFiles) < 0))
|
||||
{
|
||||
playback_err("CONTAINER_ADD failed\n");
|
||||
return cERR_PLAYBACK_ERROR;
|
||||
@@ -307,8 +307,8 @@ static int32_t PlaybackContinue(Context_t *context)
|
||||
int32_t ret = cERR_PLAYBACK_NO_ERROR;
|
||||
playback_printf(10, "\n");
|
||||
if (context->playback->isPlaying &&
|
||||
(context->playback->isPaused || context->playback->isForwarding ||
|
||||
context->playback->BackWard || context->playback->SlowMotion))
|
||||
(context->playback->isPaused || context->playback->isForwarding ||
|
||||
context->playback->BackWard || context->playback->SlowMotion))
|
||||
{
|
||||
if (context->playback->SlowMotion)
|
||||
context->output->Command(context, OUTPUT_CLEAR, NULL);
|
||||
@@ -440,7 +440,8 @@ static int PlaybackFastBackward(Context_t *context, int *speed)
|
||||
int32_t ret = cERR_PLAYBACK_NO_ERROR;
|
||||
playback_printf(10, "speed = %d\n", *speed);
|
||||
/* Audio only reverse play not supported */
|
||||
if (context->playback->isVideo && !context->playback->isForwarding && (!context->playback->isPaused || context->playback->isPlaying))
|
||||
if (context->playback->isVideo && !context->playback->isForwarding &&
|
||||
(!context->playback->isPaused || context->playback->isPlaying))
|
||||
{
|
||||
if ((*speed > 0) || (*speed < cMaxSpeed_fr))
|
||||
{
|
||||
|
Reference in New Issue
Block a user