From 485422abd8e695c01395d829415590d9f15f79cf Mon Sep 17 00:00:00 2001 From: samsamsam Date: Sun, 3 Feb 2019 12:55:42 +0100 Subject: [PATCH] Unify h263 and mpeg4 formatters Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/637e26659fd1fd33980ca4192f14ce6f4d041311 Author: samsamsam Date: 2019-02-03 (Sun, 03 Feb 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/Makefile.am | 1 - libeplayer3-arm/include/writer.h | 1 - libeplayer3-arm/output/writer/mipsel/h263.c | 162 ------------------ libeplayer3-arm/output/writer/mipsel/mpeg4.c | 17 ++ libeplayer3-arm/output/writer/mipsel/vp.c | 10 +- libeplayer3-arm/output/writer/mipsel/writer.c | 2 +- 6 files changed, 23 insertions(+), 170 deletions(-) delete mode 100644 libeplayer3-arm/output/writer/mipsel/h263.c diff --git a/libeplayer3-arm/Makefile.am b/libeplayer3-arm/Makefile.am index e9dc1bf..b29e212 100644 --- a/libeplayer3-arm/Makefile.am +++ b/libeplayer3-arm/Makefile.am @@ -51,7 +51,6 @@ SOURCE_FILES += \ output/writer/mipsel/wma.c \ output/writer/mipsel/h265.c \ output/writer/mipsel/h264.c \ - output/writer/mipsel/h263.c \ output/writer/mipsel/mjpeg.c \ output/writer/mipsel/mpeg2.c \ output/writer/mipsel/mpeg4.c \ diff --git a/libeplayer3-arm/include/writer.h b/libeplayer3-arm/include/writer.h index 54578be..fddb15b 100644 --- a/libeplayer3-arm/include/writer.h +++ b/libeplayer3-arm/include/writer.h @@ -81,7 +81,6 @@ extern Writer_t WriterVideoVC1; extern Writer_t WriterVideoVP6; extern Writer_t WriterVideoVP8; extern Writer_t WriterVideoVP9; -extern Writer_t WriterVideoSPARK; extern Writer_t WriterVideoMJPEG; extern Writer_t WriterFramebuffer; extern Writer_t WriterPipe; diff --git a/libeplayer3-arm/output/writer/mipsel/h263.c b/libeplayer3-arm/output/writer/mipsel/h263.c deleted file mode 100644 index 647300d..0000000 --- a/libeplayer3-arm/output/writer/mipsel/h263.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * crow 2010 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "stm_ioctls.h" -#include "bcm_ioctls.h" - -#include "debug.h" -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Variables */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int32_t reset() -{ - return 0; -} - -static int writeData(WriterAVCallData_t *call) -{ - uint8_t PesHeader[PES_MAX_HEADER_SIZE]; - int32_t len = 0; - - h263_printf(10, "\n"); - - if (call == NULL) - { - h263_err("call data is NULL...\n"); - return 0; - } - - h263_printf(10, "VideoPts %lld\n", call->Pts); - - if ((call->data == NULL) || (call->len <= 0)) - { - h263_err("NULL Data. ignoring...\n"); - return 0; - } - - if (call->fd < 0) - { - h263_err("file pointer < 0. ignoring ...\n"); - return 0; - } - - int32_t HeaderLength = InsertPesHeader(PesHeader, call->len, MPEG_VIDEO_PES_START_CODE, call->Pts, 0); - int32_t PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], call->len); - int32_t PesLength = PesHeader[PES_LENGTH_BYTE_0] + (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; - PesHeader[PES_FLAGS_BYTE] |= PES_EXTENSION_DATA_PRESENT; - HeaderLength += PrivateHeaderLength; - - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = HeaderLength; - iov[1].iov_base = call->data; - iov[1].iov_len = call->len; - len = call->WriteV(call->fd, iov, 2); - - h263_printf(10, "< len %d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps_h263 = -{ - "h263", - eVideo, - "V_H263", - VIDEO_ENCODING_H263, - STREAMTYPE_H263, - CT_MPEG4_PART2 -}; - -struct Writer_s WriterVideoH263 = -{ - &reset, - &writeData, - &caps_h263 -}; - -static WriterCaps_t caps_flv = -{ - "FLV", - eVideo, - "V_FLV", - VIDEO_ENCODING_FLV1, - STREAMTYPE_H263, - CT_MPEG4_PART2 -}; - -struct Writer_s WriterVideoFLV = -{ - &reset, - &writeData, - &caps_flv -}; diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg4.c b/libeplayer3-arm/output/writer/mipsel/mpeg4.c index dab2ca6..326739d 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg4.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg4.c @@ -150,3 +150,20 @@ struct Writer_s WriterVideoMPEG4 = &writeData, &mpeg4p2_caps }; + +static WriterCaps_t caps_h263 = +{ + "h263", + eVideo, + "V_H263", + VIDEO_ENCODING_H263, + STREAMTYPE_H263, + -1 +}; + +struct Writer_s WriterVideoH263 = +{ + &reset, + &writeData, + &caps_h263 +}; diff --git a/libeplayer3-arm/output/writer/mipsel/vp.c b/libeplayer3-arm/output/writer/mipsel/vp.c index 4922287..fe348b1 100644 --- a/libeplayer3-arm/output/writer/mipsel/vp.c +++ b/libeplayer3-arm/output/writer/mipsel/vp.c @@ -287,19 +287,19 @@ struct Writer_s WriterVideoVP9 = &capsVP9 }; -static WriterCaps_t capsSPARK = +static WriterCaps_t capsFLV = { - "spark", + "flv1", eVideo, - "V_SPARK", + "V_FLV", VIDEO_ENCODING_VC1, STREAMTYPE_SPARK, CT_SPARK }; -struct Writer_s WriterVideoSPARK = +struct Writer_s WriterVideoFLV = { &reset, &writeDataVP8, - &capsSPARK + &capsFLV }; diff --git a/libeplayer3-arm/output/writer/mipsel/writer.c b/libeplayer3-arm/output/writer/mipsel/writer.c index bd6d484..f8853a0 100644 --- a/libeplayer3-arm/output/writer/mipsel/writer.c +++ b/libeplayer3-arm/output/writer/mipsel/writer.c @@ -83,7 +83,7 @@ static Writer_t *AvailableWriter[] = &WriterVideoVP6, &WriterVideoVP8, &WriterVideoVP9, - &WriterVideoSPARK, + &WriterVideoFLV, &WriterVideoWMV, &WriterVideoMJPEG, NULL