mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
libeplayer3-arm: Code formatting
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
|
/* 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
|
* this is the reason for additional validation when we what to close immediately
|
||||||
*/
|
*/
|
||||||
if (!progressive_playback && 0 == ret && currPts >= maxInjectedPts &&
|
if (!progressive_playback && 0 == ret && currPts >= maxInjectedPts && ((currPts - maxInjectedPts) / 90000) < 2)
|
||||||
((currPts - maxInjectedPts) / 90000) < 2)
|
|
||||||
{
|
{
|
||||||
/* close immediately
|
/* close immediately
|
||||||
*/
|
*/
|
||||||
|
@@ -1108,7 +1108,7 @@ static void FFMPEGThread(Context_t *context)
|
|||||||
printf("{\"log\":\"Frame read error: '%s'\"}\n", errbuf);
|
printf("{\"log\":\"Frame read error: '%s'\"}\n", errbuf);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if( ffmpegStatus == AVERROR(EAGAIN) )
|
if(ffmpegStatus == AVERROR(EAGAIN))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1261,8 +1261,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.callback = interrupt_cb;
|
||||||
avContextTab[AVIdx]->interrupt_callback.opaque = context->playback;
|
avContextTab[AVIdx]->interrupt_callback.opaque = context->playback;
|
||||||
#ifdef SAM_CUSTOM_IO
|
#ifdef SAM_CUSTOM_IO
|
||||||
if (0 == strstr(filename, "://") ||
|
if (0 == strstr(filename, "://") || 0 == strncmp(filename, "file://", 7))
|
||||||
0 == strncmp(filename, "file://", 7))
|
|
||||||
{
|
{
|
||||||
AVIOContext *avio_ctx = container_ffmpeg_get_avio_context(filename, 4096);
|
AVIOContext *avio_ctx = container_ffmpeg_get_avio_context(filename, 4096);
|
||||||
if (avio_ctx)
|
if (avio_ctx)
|
||||||
@@ -1334,8 +1333,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
|||||||
* unless uri contain param wich can be understandable
|
* unless uri contain param wich can be understandable
|
||||||
* only by librtmp
|
* only by librtmp
|
||||||
*/
|
*/
|
||||||
if (strstr(filename, " token=") ||
|
if (strstr(filename, " token=") || strstr(filename, " jtv="))
|
||||||
strstr(filename, " jtv="))
|
|
||||||
{
|
{
|
||||||
rtmpProtoImplType = RTMP_LIBRTMP;
|
rtmpProtoImplType = RTMP_LIBRTMP;
|
||||||
}
|
}
|
||||||
@@ -1479,8 +1477,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (0 == strncmp(filename, "http://", 7) ||
|
else if (0 == strncmp(filename, "http://", 7) || 0 == strncmp(filename, "https://", 8))
|
||||||
0 == strncmp(filename, "https://", 8))
|
|
||||||
{
|
{
|
||||||
av_dict_set(&avio_opts, "timeout", "20000000", 0); //20sec
|
av_dict_set(&avio_opts, "timeout", "20000000", 0); //20sec
|
||||||
av_dict_set(&avio_opts, "reconnect", "1", 0);
|
av_dict_set(&avio_opts, "reconnect", "1", 0);
|
||||||
@@ -1532,8 +1529,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)
|
if (avContextTab[AVIdx] != NULL && avContextTab[AVIdx]->pb != NULL && !context->playback->isTSLiveMode)
|
||||||
{
|
{
|
||||||
ffmpeg_real_read_org = avContextTab[AVIdx]->pb->read_packet;
|
ffmpeg_real_read_org = avContextTab[AVIdx]->pb->read_packet;
|
||||||
if (0 == AVIdx && strstr(filename, "://") != 0 &&
|
if (0 == AVIdx && strstr(filename, "://") != 0 && strncmp(filename, "file://", 7) != 0)
|
||||||
strncmp(filename, "file://", 7) != 0)
|
|
||||||
{
|
{
|
||||||
if (ffmpeg_buf_size > 0 && ffmpeg_buf_size > FILLBUFDIFF + FILLBUFPAKET)
|
if (ffmpeg_buf_size > 0 && ffmpeg_buf_size > FILLBUFDIFF + FILLBUFPAKET)
|
||||||
{
|
{
|
||||||
@@ -1601,7 +1597,7 @@ int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames)
|
|||||||
avformat_network_init();
|
avformat_network_init();
|
||||||
// SULGE DEBUG ENABLED
|
// SULGE DEBUG ENABLED
|
||||||
// make ffmpeg silen
|
// make ffmpeg silen
|
||||||
// av_log_set_level( AV_LOG_DEBUG );
|
// av_log_set_level(AV_LOG_DEBUG);
|
||||||
av_log_set_callback(ffmpeg_silen_callback);
|
av_log_set_callback(ffmpeg_silen_callback);
|
||||||
context->playback->abortRequested = 0;
|
context->playback->abortRequested = 0;
|
||||||
int32_t res = container_ffmpeg_init_av_context(context, playFilesNames->szFirstFile, 0);
|
int32_t res = container_ffmpeg_init_av_context(context, playFilesNames->szFirstFile, 0);
|
||||||
@@ -1961,10 +1957,10 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else if (get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAV1
|
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_WMAV2 ||
|
||||||
|| get_codecpar(stream)->codec_id == AV_CODEC_ID_WMAPRO
|
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)
|
get_codecpar(stream)->codec_id == AV_CODEC_ID_WMALOSSLESS) //if (get_codecpar(stream)->extradata_size > 0)
|
||||||
{
|
{
|
||||||
ffmpeg_printf(10, "Create WMA ExtraData\n");
|
ffmpeg_printf(10, "Create WMA ExtraData\n");
|
||||||
uint16_t channels = get_codecpar(stream)->channels;
|
uint16_t channels = get_codecpar(stream)->channels;
|
||||||
@@ -2509,7 +2505,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)
|
static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg)
|
||||||
{
|
{
|
||||||
ffmpeg_printf(10, "track %d\n", *arg);
|
ffmpeg_printf(10, "track %d\n", *arg);
|
||||||
/* Hellmaster1024: nothing to do here!*/
|
/* Hellmaster1024: nothing to do here! */
|
||||||
int64_t sec = -5;
|
int64_t sec = -5;
|
||||||
context->playback->Command(context, PLAYBACK_SEEK, (void *)&sec);
|
context->playback->Command(context, PLAYBACK_SEEK, (void *)&sec);
|
||||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||||
|
4
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
4
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
@@ -465,7 +465,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s)
|
|||||||
|
|
||||||
#define GET_RL_VLC(level, run, name, gb, table, bits, \
|
#define GET_RL_VLC(level, run, name, gb, table, bits, \
|
||||||
max_depth, need_update) \
|
max_depth, need_update) \
|
||||||
do { \
|
do { \
|
||||||
int n, nb_bits; \
|
int n, nb_bits; \
|
||||||
unsigned int index; \
|
unsigned int index; \
|
||||||
\
|
\
|
||||||
@@ -498,7 +498,7 @@ do { \
|
|||||||
} \
|
} \
|
||||||
run = table[index].run; \
|
run = table[index].run; \
|
||||||
SKIP_BITS(name, gb, n); \
|
SKIP_BITS(name, gb, n); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static inline int decode012(GetBitContext *gb)
|
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
|
#endif
|
||||||
|
|
||||||
#ifndef NEG_SSR32
|
#ifndef NEG_SSR32
|
||||||
# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
|
# define NEG_SSR32(a,s) (((int32_t)(a))>>(32-(s)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef sign_extend
|
#ifndef sign_extend
|
||||||
|
@@ -36,8 +36,7 @@ void avpriv_align_put_bits(PutBitContext *s)
|
|||||||
put_bits(s, s->bit_left & 7, 0);
|
put_bits(s, s->bit_left & 7, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void avpriv_put_string(PutBitContext *pb, const char *string,
|
void avpriv_put_string(PutBitContext *pb, const char *string, int terminate_string)
|
||||||
int terminate_string)
|
|
||||||
{
|
{
|
||||||
while (*string)
|
while (*string)
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#ifndef COMMON_H_
|
#ifndef COMMON_H_
|
||||||
#define COMMON_H_
|
#define COMMON_H_
|
||||||
|
|
||||||
#include<stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "container.h"
|
#include "container.h"
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
|
@@ -86,7 +86,6 @@ typedef struct TrackDescription_s
|
|||||||
int32_t aspect_ratio_num;
|
int32_t aspect_ratio_num;
|
||||||
int32_t aspect_ratio_den;
|
int32_t aspect_ratio_den;
|
||||||
int progressive;
|
int progressive;
|
||||||
|
|
||||||
} TrackDescription_t;
|
} TrackDescription_t;
|
||||||
|
|
||||||
typedef struct Manager_s
|
typedef struct Manager_s
|
||||||
@@ -94,7 +93,6 @@ typedef struct Manager_s
|
|||||||
char *Name;
|
char *Name;
|
||||||
int (* Command)(/*Context_t*/void *, ManagerCmd_t, void *);
|
int (* Command)(/*Context_t*/void *, ManagerCmd_t, void *);
|
||||||
char **Capabilities;
|
char **Capabilities;
|
||||||
|
|
||||||
} Manager_t;
|
} Manager_t;
|
||||||
|
|
||||||
typedef struct ManagerHandler_s
|
typedef struct ManagerHandler_s
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#define OUTPUT_H_
|
#define OUTPUT_H_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
@@ -69,7 +70,6 @@ typedef struct Output_s
|
|||||||
int32_t (* Command)(/*Context_t*/void *, OutputCmd_t, void *);
|
int32_t (* Command)(/*Context_t*/void *, OutputCmd_t, void *);
|
||||||
int32_t (* Write)(/*Context_t*/void *, void *privateData);
|
int32_t (* Write)(/*Context_t*/void *, void *privateData);
|
||||||
char **Capabilities;
|
char **Capabilities;
|
||||||
|
|
||||||
} Output_t;
|
} Output_t;
|
||||||
|
|
||||||
extern Output_t LinuxDvbOutput;
|
extern Output_t LinuxDvbOutput;
|
||||||
|
@@ -3,7 +3,28 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdint.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
|
typedef struct PlaybackHandler_s
|
||||||
{
|
{
|
||||||
|
@@ -119,8 +119,7 @@ static void *TermThreadFun(void *arg)
|
|||||||
FD_SET(g_pfd[0], &readfds);
|
FD_SET(g_pfd[0], &readfds);
|
||||||
FD_SET(fd, &readfds);
|
FD_SET(fd, &readfds);
|
||||||
nfds = fd > g_pfd[0] ? fd + 1 : g_pfd[0] + 1;
|
nfds = fd > g_pfd[0] ? fd + 1 : g_pfd[0] + 1;
|
||||||
while (select(nfds, &readfds, NULL, NULL, NULL) == -1
|
while (select(nfds, &readfds, NULL, NULL, NULL) == -1 && errno == EINTR)
|
||||||
&& errno == EINTR)
|
|
||||||
{
|
{
|
||||||
/* Restart if interrupted by signal */
|
/* Restart if interrupted by signal */
|
||||||
continue;
|
continue;
|
||||||
@@ -128,7 +127,7 @@ static void *TermThreadFun(void *arg)
|
|||||||
if (FD_ISSET(fd, &readfds))
|
if (FD_ISSET(fd, &readfds))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if ( (cl = accept(fd, NULL, NULL)) == -1)
|
if ((cl = accept(fd, NULL, NULL)) == -1)
|
||||||
{
|
{
|
||||||
perror("TermThreadFun accept error");
|
perror("TermThreadFun accept error");
|
||||||
goto finish;
|
goto finish;
|
||||||
@@ -475,6 +474,7 @@ static int HandleTracks(const Manager_t *ptrManager, const PlaybackCmd_t playbac
|
|||||||
return commandRetVal;
|
return commandRetVal;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void UpdateVideoTrack()
|
static void UpdateVideoTrack()
|
||||||
{
|
{
|
||||||
HandleTracks(g_player->manager->video, (PlaybackCmd_t) - 1, "vc");
|
HandleTracks(g_player->manager->video, (PlaybackCmd_t) - 1, "vc");
|
||||||
|
@@ -430,7 +430,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int
|
|||||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||||
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
||||||
// linuxdvb_printf(50, "\n");
|
// 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("ioctl failed with errno %d\n", errno);
|
||||||
// linuxdvb_err("VIDEO_DISCONTINUITY: %s\n", strerror(errno));
|
// linuxdvb_err("VIDEO_DISCONTINUITY: %s\n", strerror(errno));
|
||||||
@@ -479,7 +479,7 @@ int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
|
|||||||
// unsigned char video = !strcmp("video", type);
|
// unsigned char video = !strcmp("video", type);
|
||||||
// unsigned char audio = !strcmp("audio", type);
|
// unsigned char audio = !strcmp("audio", type);
|
||||||
// linuxdvb_printf(10, "v%d a%d\n", video, audio);
|
// 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__);
|
// getLinuxDVBMutex(FILENAME, __FUNCTION__,__LINE__);
|
||||||
// if (video && videofd != -1) {
|
// if (video && videofd != -1) {
|
||||||
// if (ioctl(videofd, VIDEO_FLUSH, NULL) == -1)
|
// if (ioctl(videofd, VIDEO_FLUSH, NULL) == -1)
|
||||||
@@ -727,7 +727,7 @@ int LinuxDvbSwitch(Context_t *context, char *type)
|
|||||||
if (writer == NULL)
|
if (writer == NULL)
|
||||||
{
|
{
|
||||||
linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding);
|
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("ioctl failed with errno %d\n", errno);
|
||||||
// linuxdvb_err("AUDIO_SET_BYPASS_MODE: %s\n", strerror(errno));
|
// linuxdvb_err("AUDIO_SET_BYPASS_MODE: %s\n", strerror(errno));
|
||||||
@@ -775,7 +775,7 @@ int LinuxDvbSwitch(Context_t *context, char *type)
|
|||||||
if (writer == NULL)
|
if (writer == NULL)
|
||||||
{
|
{
|
||||||
linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding);
|
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("ioctl failed with errno %d\n", errno);
|
||||||
// linuxdvb_err("VIDEO_SET_STREAMTYPE: %s\n", strerror(errno));
|
// linuxdvb_err("VIDEO_SET_STREAMTYPE: %s\n", strerror(errno));
|
||||||
|
@@ -59,7 +59,7 @@ static const char FILENAME[] = __FILE__;
|
|||||||
|
|
||||||
#ifdef LINUXDVB_DEBUG
|
#ifdef LINUXDVB_DEBUG
|
||||||
#define linuxdvb_printf(level, fmt, x...) do { \
|
#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
|
#else
|
||||||
#define linuxdvb_printf(x...)
|
#define linuxdvb_printf(x...)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -106,6 +106,7 @@ static uint8_t brcm_divx311_sequence_header[] =
|
|||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* MISC Functions */
|
/* MISC Functions */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
static int reset()
|
static int reset()
|
||||||
{
|
{
|
||||||
initialHeader = 1;
|
initialHeader = 1;
|
||||||
|
@@ -69,6 +69,7 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x);
|
|||||||
#else
|
#else
|
||||||
#define h263_err(fmt, x...)
|
#define h263_err(fmt, x...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* Types */
|
/* Types */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
@@ -266,8 +266,7 @@ static int32_t writeData(void *_call)
|
|||||||
iov[1].iov_len = fixed_buffersize;
|
iov[1].iov_len = fixed_buffersize;
|
||||||
writev_with_retry(call->fd, iov, 2);
|
writev_with_retry(call->fd, iov, 2);
|
||||||
fixed_buffertimestamp += fixed_bufferduration;
|
fixed_buffertimestamp += fixed_bufferduration;
|
||||||
int g_fd_dump = open("/hdd/lpcm/ffmpeg.pes", O_CREAT |
|
int g_fd_dump = open("/hdd/lpcm/ffmpeg.pes", O_CREAT | O_RDWR | O_APPEND, S_IRUSR | S_IWUSR);
|
||||||
O_RDWR | O_APPEND, S_IRUSR | S_IWUSR);
|
|
||||||
writev_with_retry(g_fd_dump, iov, 2);
|
writev_with_retry(g_fd_dump, iov, 2);
|
||||||
close(g_fd_dump);
|
close(g_fd_dump);
|
||||||
}
|
}
|
||||||
|
@@ -100,6 +100,7 @@ static video_codec_data_t videocodecdata = {0, 0};
|
|||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* MISC Functions */
|
/* MISC Functions */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
static int reset()
|
static int reset()
|
||||||
{
|
{
|
||||||
initialHeader = 1;
|
initialHeader = 1;
|
||||||
@@ -153,8 +154,8 @@ static int writeData(void *_call)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint8_t needFrameStartCode = 0;
|
uint8_t needFrameStartCode = 0;
|
||||||
if (sizeof(Vc1FrameStartCode) >= call->len
|
if (sizeof(Vc1FrameStartCode) >= call->len ||
|
||||||
|| memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
||||||
{
|
{
|
||||||
needFrameStartCode = 1;
|
needFrameStartCode = 1;
|
||||||
PacketLength += sizeof(Vc1FrameStartCode);
|
PacketLength += sizeof(Vc1FrameStartCode);
|
||||||
|
@@ -98,6 +98,7 @@ static video_codec_data_t videocodecdata = {0, 0};
|
|||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* MISC Functions */
|
/* MISC Functions */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
static int reset()
|
static int reset()
|
||||||
{
|
{
|
||||||
initialHeader = 1;
|
initialHeader = 1;
|
||||||
@@ -159,8 +160,8 @@ static int writeData(void *_call)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint8_t needFrameStartCode = 0;
|
uint8_t needFrameStartCode = 0;
|
||||||
if (sizeof(Vc1FrameStartCode) >= call->len
|
if (sizeof(Vc1FrameStartCode) >= call->len ||
|
||||||
|| memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
memcmp(call->data, Vc1FrameStartCode, sizeof(Vc1FrameStartCode)) != 0)
|
||||||
{
|
{
|
||||||
needFrameStartCode = 1;
|
needFrameStartCode = 1;
|
||||||
PacketLength += sizeof(Vc1FrameStartCode);
|
PacketLength += sizeof(Vc1FrameStartCode);
|
||||||
|
@@ -99,6 +99,7 @@ static Writer_t *AvailableWriter[] =
|
|||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* Functions */
|
/* Functions */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
ssize_t write_with_retry(int fd, const void *buf, size_t size)
|
ssize_t write_with_retry(int fd, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
@@ -52,6 +52,7 @@
|
|||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* Makros/Constants */
|
/* Makros/Constants */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
#ifdef SAM_WITH_DEBUG
|
#ifdef SAM_WITH_DEBUG
|
||||||
#define H264_DEBUG
|
#define H264_DEBUG
|
||||||
#else
|
#else
|
||||||
|
@@ -103,7 +103,7 @@ static const unsigned char Metadata[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* Varaibles */
|
/* Variables */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
static int initialHeader = 1;
|
static int initialHeader = 1;
|
||||||
|
@@ -207,8 +207,7 @@ static int writeData(void *_call)
|
|||||||
{
|
{
|
||||||
unsigned int PesLength;
|
unsigned int PesLength;
|
||||||
unsigned int PrivateHeaderLength;
|
unsigned int PrivateHeaderLength;
|
||||||
PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength],
|
PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], call->len);
|
||||||
call->len);
|
|
||||||
/* Update PesLength */
|
/* Update PesLength */
|
||||||
PesLength = PesHeader[PES_LENGTH_BYTE_0] +
|
PesLength = PesHeader[PES_LENGTH_BYTE_0] +
|
||||||
(PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength;
|
(PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength;
|
||||||
|
@@ -175,9 +175,9 @@ static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles)
|
|||||||
return cERR_PLAYBACK_ERROR;
|
return cERR_PLAYBACK_ERROR;
|
||||||
}
|
}
|
||||||
pFiles->szFirstFile = context->playback->uri;
|
pFiles->szFirstFile = context->playback->uri;
|
||||||
if ((context->container->Command(context, CONTAINER_ADD, extension) < 0)
|
if ((context->container->Command(context, CONTAINER_ADD, extension) < 0) ||
|
||||||
|| (!context->container->selectedContainer)
|
(!context->container->selectedContainer) ||
|
||||||
|| (context->container->selectedContainer->Command(context, CONTAINER_INIT, pFiles) < 0))
|
(context->container->selectedContainer->Command(context, CONTAINER_INIT, pFiles) < 0))
|
||||||
{
|
{
|
||||||
playback_err("CONTAINER_ADD failed\n");
|
playback_err("CONTAINER_ADD failed\n");
|
||||||
return cERR_PLAYBACK_ERROR;
|
return cERR_PLAYBACK_ERROR;
|
||||||
@@ -440,7 +440,8 @@ static int PlaybackFastBackward(Context_t *context, int *speed)
|
|||||||
int32_t ret = cERR_PLAYBACK_NO_ERROR;
|
int32_t ret = cERR_PLAYBACK_NO_ERROR;
|
||||||
playback_printf(10, "speed = %d\n", *speed);
|
playback_printf(10, "speed = %d\n", *speed);
|
||||||
/* Audio only reverse play not supported */
|
/* 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))
|
if ((*speed > 0) || (*speed < cMaxSpeed_fr))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user