demuxfs-devel Mailing List for DemuxFS
Status: Beta
Brought to you by:
lucasvr
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(35) |
Nov
(7) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(54) |
Feb
(2) |
Mar
(1) |
Apr
|
May
(31) |
Jun
(20) |
Jul
(74) |
Aug
(12) |
Sep
(4) |
Oct
|
Nov
(5) |
Dec
(12) |
2010 |
Jan
(2) |
Feb
(3) |
Mar
|
Apr
|
May
(6) |
Jun
(8) |
Jul
(7) |
Aug
(13) |
Sep
(6) |
Oct
(4) |
Nov
(3) |
Dec
(4) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <lu...@us...> - 2016-05-25 00:20:49
|
Revision: 411 http://sourceforge.net/p/demuxfs/code/411 Author: lucasvr Date: 2016-05-25 00:20:47 +0000 (Wed, 25 May 2016) Log Message: ----------- Redirect users to github. Added Paths: ----------- README Removed Paths: ------------- AUTHORS COPYING Makefile.am autogen.sh build-aux/ configure.ac src/ Deleted: AUTHORS =================================================================== --- AUTHORS 2015-03-04 19:35:07 UTC (rev 410) +++ AUTHORS 2016-05-25 00:20:47 UTC (rev 411) @@ -1 +0,0 @@ -DemuxFS is written by Lucas C. Villa Real <lu...@go...> Deleted: COPYING =================================================================== --- COPYING 2015-03-04 19:35:07 UTC (rev 410) +++ COPYING 2016-05-25 00:20:47 UTC (rev 411) @@ -1,27 +0,0 @@ -Copyright (c) 2008, Lucas C. Villa Real <lu...@go...> -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of GoboLinux nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Deleted: Makefile.am =================================================================== --- Makefile.am 2015-03-04 19:35:07 UTC (rev 410) +++ Makefile.am 2016-05-25 00:20:47 UTC (rev 411) @@ -1 +0,0 @@ -SUBDIRS=src Added: README =================================================================== --- README (rev 0) +++ README 2016-05-25 00:20:47 UTC (rev 411) @@ -0,0 +1 @@ +This project is now hosted at https://github.com/lucasvr/demuxfs. Deleted: autogen.sh =================================================================== --- autogen.sh 2015-03-04 19:35:07 UTC (rev 410) +++ autogen.sh 2016-05-25 00:20:47 UTC (rev 411) @@ -1,4 +0,0 @@ -#!/bin/sh - -exec autoreconf -i -v - Deleted: configure.ac =================================================================== --- configure.ac 2015-03-04 19:35:07 UTC (rev 410) +++ configure.ac 2016-05-25 00:20:47 UTC (rev 411) @@ -1,160 +0,0 @@ -dnl -dnl DemuxFS' configure.ac. -dnl Based on the work done by Iuri Gomes Diniz. -dnl -AC_INIT([DEMUXFS], [0.1], [lu...@go...]) -AC_CONFIG_AUX_DIR([build-aux]) -AC_PROG_CC_C99 -m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -AC_PROG_LIBTOOL - -dnl -dnl Check for LibFUSE (mandatory) -dnl -AC_MSG_CHECKING([fuse compatibility]) -if test -z "$PKG_CONFIG" -then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -fi -if test "x${PKG_CONFIG}" = "xno" -then - AC_MSG_ERROR([pkg-config was not found! Please install from your vendor, or see http://pkg-config.freedesktop.org/wiki/]) -fi -PKG_CHECK_MODULES([FUSE_MODULE], - [fuse >= 2.6.0], , - [ AC_MSG_ERROR([FUSE >= 2.6.0 was not found. Please fetch it from http://fuse.sf.net]) ] -) -FUSE_LIBS=`$PKG_CONFIG --libs fuse` -FUSE_CFLAGS=`$PKG_CONFIG --cflags fuse` - - -dnl -dnl Check for FFMPEG (optional) -dnl -jpeg_found= -ffmpeg_found= -AC_MSG_CHECKING([ffmpeg]) -PKG_CHECK_MODULES([LIBAVCODEC_MODULE], [libavcodec >= 52.7.0], ffmpeg_found="yes", - AC_MSG_RESULT([Support for snapshots will be disabled.])) -if test ! -z "${ffmpeg_found}" -then - dnl - dnl Check for libavcodec - dnl - libavcodec=no - AC_MSG_CHECKING([libavcodec]) - FFMPEG_LIBS=`$PKG_CONFIG --libs libavcodec` - FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavcodec` - PKG_CHECK_MODULES([LIBAVCODEC_MODULE], [libavcodec >= 0.7.1], libavcodec_found="yes", - AC_MSG_RESULT([FFmpeg was compiled with no support for libavcodec.])) - AVCODEC_LIBS=`$PKG_CONFIG --libs libavcodec` - - dnl - dnl Check for libavutil - dnl - libavutil_found=no - AC_MSG_CHECKING([libavutil]) - FFMPEG_LIBS=`$PKG_CONFIG --libs libavutil` - FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavutil` - PKG_CHECK_MODULES([LIBAVUTIL_MODULE], [libavutil >= 0.7.1], libavutil_found="yes", - AC_MSG_RESULT([FFmpeg was compiled with no support for libavutil.])) - AVUTIL_LIBS=`$PKG_CONFIG --libs libavutil` - - dnl - dnl Check for libswscale - dnl - libswscale_found=no - AC_MSG_CHECKING([libswscale]) - FFMPEG_LIBS=`$PKG_CONFIG --libs libavcodec` - FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavcodec` - PKG_CHECK_MODULES([LIBSWSCALE_MODULE], [libswscale >= 0.7.1], libswscale_found="yes", - AC_MSG_RESULT([FFmpeg was compiled with no support for libswscale.])) - SWSCALE_LIBS=`$PKG_CONFIG --libs libswscale` - - dnl - dnl Check for libavformat - dnl - libavformat_found=no - AC_MSG_CHECKING([libavformat]) - FFMPEG_LIBS=`$PKG_CONFIG --libs libavformat` - FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavformat` - PKG_CHECK_MODULES([LIBAVFORMAT_MODULE], [libavformat >= 0.7.1], libavformat_found="yes", - AC_MSG_RESULT([FFmpeg libavformat was not found.])) - AVFORMAT_LIBS=`$PKG_CONFIG --libs libavformat` - - if test "x$libswscale_found" != "xno" && test "x$libavformat_found" != "xno" && - test "x$libavutil_found" != "xno" && test "x$libavcodec_found" != "xno" - then - CFLAGS="${CFLAGS} -DUSE_FFMPEG" - fi -fi -AM_CONDITIONAL(USE_FFMPEG, test "${ffmpeg_found}" = "yes") - -dnl -dnl Verify native support for FIFOs -dnl -mkfifo_found= -AC_CHECK_LIB([c], [mkfifo], [mkfifo_found=yes], AC_MSG_RESULT([Will emulate FIFOs.])) -if test ! -z "${mkfifo_found}" -then - CFLAGS="${CFLAGS} -DUSE_POSIX_FIFOS" -fi -AM_CONDITIONAL(USE_POSIX_FIFOS, test "${mkfifo_found}" = "yes") - -dnl -dnl Select backend. Available options are "filesrc" and "linuxdvb". -dnl -validbackend=false -AC_ARG_WITH(backend, [ --with-backend=[[filesrc|linuxdvb|all] (default=all)]]) - -use_filesrc=false -if test "${with_backend}" = "filesrc" -o "${with_backend}" = "all" -o "${with_backend}" = "" -then - dnl - dnl set USE_FILESRC - dnl - CFLAGS="${CFLAGS} -DUSE_FILESRC" - use_filesrc=true - validbackend=true -fi - -use_linuxdvb=false -if test "${with_backend}" = "linuxdvb" -o "${with_backend}" = "all" -o "${with_backend}" = "" -then - dnl - dnl set USE_LINUXDVB - dnl - CFLAGS="${CFLAGS} -DUSE_LINUXDVB" - use_linuxdvb=true - validbackend=true -fi - -AM_CONDITIONAL(USE_FILESRC, test "${use_filesrc}" = "true") -AM_CONDITIONAL(USE_LINUXDVB, test "${use_linuxdvb}" = "true") - -if test -z "$validbackend" -then - AC_MSG_ERROR([Invalid backend selected.]) -fi - -dnl -dnl Update flags -dnl -CFLAGS="${CFLAGS} ${FUSE_CFLAGS} ${FFMPEG_CFLAGS} -ggdb -O3 -Wall" -LDFLAGS="${LDFLAGS} ${FUSE_LIBS} ${FFMPEG_LIBS} ${AVCODEC_LIBS} ${AVUTIL_LIBS} ${SWSCALE_LIBS} ${AVFORMAT_LIBS}" - -dnl -dnl Output files -dnl -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([ - Makefile - src/Makefile - src/backends/Makefile - src/dsm-cc/Makefile - src/dsm-cc/descriptors/Makefile - src/tables/Makefile - src/tables/descriptors/Makefile -]) -AC_OUTPUT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2015-03-04 19:35:09
|
Revision: 410 http://sourceforge.net/p/demuxfs/code/410 Author: lucasvr Date: 2015-03-04 19:35:07 +0000 (Wed, 04 Mar 2015) Log Message: ----------- Test if the list had been initialized before deleting it. Modified Paths: -------------- src/fsutils.c Modified: src/fsutils.c =================================================================== --- src/fsutils.c 2015-03-01 16:14:14 UTC (rev 409) +++ src/fsutils.c 2015-03-04 19:35:07 UTC (rev 410) @@ -177,7 +177,8 @@ free(dentry->name); pthread_mutex_destroy(&dentry->mutex); sem_destroy(&dentry->semaphore); - list_del(&dentry->list); + if (! list_poisoned(&dentry->list)) + list_del(&dentry->list); free(dentry); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2015-03-01 16:14:21
|
Revision: 409 http://sourceforge.net/p/demuxfs/code/409 Author: lucasvr Date: 2015-03-01 16:14:14 +0000 (Sun, 01 Mar 2015) Log Message: ----------- Make sure we link to the dl library. Modified Paths: -------------- src/Makefile.am Modified: src/Makefile.am =================================================================== --- src/Makefile.am 2015-02-28 18:45:08 UTC (rev 408) +++ src/Makefile.am 2015-03-01 16:14:14 UTC (rev 409) @@ -15,7 +15,7 @@ bin_PROGRAMS = demuxfs demuxfs_SOURCES = main.c backend.c demuxfs_DEPENDENCIES = libdemuxfs.la -demuxfs_LDADD = libdemuxfs.la +demuxfs_LDADD = libdemuxfs.la -ldl demuxfs_CPPFLAGS = -I${top_srcdir}/src/backends -I${top_srcdir}/src/tables -DLIBDIR="\"@libdir@\"" SUBDIRS = dsm-cc tables backends This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2015-02-28 18:45:10
|
Revision: 408 http://sourceforge.net/p/demuxfs/code/408 Author: lucasvr Date: 2015-02-28 18:45:08 +0000 (Sat, 28 Feb 2015) Log Message: ----------- Enable reading from FIFOs. Modified Paths: -------------- src/backends/filesrc.c Modified: src/backends/filesrc.c =================================================================== --- src/backends/filesrc.c 2015-02-28 18:41:40 UTC (rev 407) +++ src/backends/filesrc.c 2015-02-28 18:45:08 UTC (rev 408) @@ -68,23 +68,40 @@ static bool search_sync_byte(struct input_parser *p, uint8_t packet_size) { - int attempts = 5; - char data1, data2; - long offset = ftell(p->fp); + char data, data1 = 0, data2 = 0; + struct stat statbuf; + int i, attempts = 5; + long offset; + size_t n; - while (attempts > 0 && ! feof(p->fp)) { - fread(&data1, 1, sizeof(char), p->fp); - fseek(p->fp, packet_size-1, SEEK_CUR); - fread(&data2, 1, sizeof(char), p->fp); - if (data1 != TS_SYNC_BYTE || data2 != TS_SYNC_BYTE) { - rewind(p->fp); - return false; + if (fstat(fileno(p->fp), &statbuf) == 0 && S_ISFIFO(statbuf.st_mode)) { + /* Read two full packets */ + for (i=0; i<((int) packet_size)*2; ++i) { + n = fread(&data, 1, sizeof(char), p->fp); + if (n <= 0) { + fprintf(stderr, "fread(FIFO): %s\n", strerror(errno)); + return false; + } + if (i == 0) data1 = data; + if (i == packet_size) data2 = data; } - fseek(p->fp, -1, SEEK_CUR); - attempts--; + return data1 == TS_SYNC_BYTE && data2 == TS_SYNC_BYTE; + } else { + offset = ftell(p->fp); + while (attempts > 0 && ! feof(p->fp)) { + fread(&data1, 1, sizeof(char), p->fp); + fseek(p->fp, packet_size-1, SEEK_CUR); + fread(&data2, 1, sizeof(char), p->fp); + if (data1 != TS_SYNC_BYTE || data2 != TS_SYNC_BYTE) { + rewind(p->fp); + return false; + } + fseek(p->fp, -1, SEEK_CUR); + attempts--; + } + fseek(p->fp, offset, SEEK_SET); + return true; } - fseek(p->fp, offset, SEEK_SET); - return true; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2015-02-28 18:41:42
|
Revision: 407 http://sourceforge.net/p/demuxfs/code/407 Author: lucasvr Date: 2015-02-28 18:41:40 +0000 (Sat, 28 Feb 2015) Log Message: ----------- Update usage message. Modified Paths: -------------- src/backends/linuxdvb.c Modified: src/backends/linuxdvb.c =================================================================== --- src/backends/linuxdvb.c 2014-07-31 18:30:14 UTC (rev 406) +++ src/backends/linuxdvb.c 2015-02-28 18:41:40 UTC (rev 407) @@ -75,7 +75,7 @@ " -o frontend_device=FILE frontend device (default=%s)\n" " -o demux_device=FILE demux device (default=%s)\n" " -o dvr_device=FILE DVR device (default=%s)\n" - " -o frequency=FREQ Frequency (default=%d)\n" + " -o frequency=FREQ Frequency (default=%d -- do not configure frontend)\n" " -o symbol_rate=RATE Symbol rate (default=%d)\n" " -o qpsk_voltage=<13|18> QPSK voltage (default=%d)\n" " -o qpsk_tone=<1|0> QPSK tone (default=%d)\n", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-31 18:30:26
|
Revision: 406 http://sourceforge.net/p/demuxfs/code/406 Author: lucasvr Date: 2014-07-31 18:30:14 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Initial parser for the DATA_STREAM_ALIGNMENT_DESCRIPTOR. Modified Paths: -------------- src/tables/descriptors/parser_0x06.c Modified: src/tables/descriptors/parser_0x06.c =================================================================== --- src/tables/descriptors/parser_0x06.c 2014-07-31 18:25:57 UTC (rev 405) +++ src/tables/descriptors/parser_0x06.c 2014-07-31 18:30:14 UTC (rev 406) @@ -30,10 +30,26 @@ #include "fsutils.h" #include "xattr.h" #include "ts.h" +#include "descriptors.h" +// http://www.etherguidesystems.com/help/sdos/mpeg/semantics/mpeg-2/alignment_type.aspx + +struct data_stream_alignment_descriptor { + uint8_t alignment_type; +}; + /* DATA_STREAM_ALIGNMENT_DESCRIPTOR parser */ int descriptor_0x06_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv) { - return -ENOSYS; + if (! descriptor_is_parseable(parent, payload[0], 3, len)) + return -ENODATA; + + struct data_stream_alignment_descriptor dsa; + dsa.alignment_type = payload[2]; + + TS_WARNING("0x06_parser: DATA_STREAM_ALIGNMENT_DESCRIPTOR parser is not fully implemented"); + struct dentry *subdir = CREATE_DIRECTORY(parent, "Data_Stream_Alignment_Descriptor"); + CREATE_FILE_NUMBER(subdir, &dsa, alignment_type); + return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-31 18:26:00
|
Revision: 405 http://sourceforge.net/p/demuxfs/code/405 Author: lucasvr Date: 2014-07-31 18:25:57 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Print the TOT information only the first time the table is seen (otherwise we may flood stdout). Modified Paths: -------------- src/tables/tot.c Modified: src/tables/tot.c =================================================================== --- src/tables/tot.c 2014-07-31 18:24:00 UTC (rev 404) +++ src/tables/tot.c 2014-07-31 18:25:57 UTC (rev 405) @@ -171,9 +171,6 @@ tot->dentry->inode = TS_PACKET_HASH_KEY(header, tot); current_tot = hashtable_get(priv->psi_tables, tot->dentry->inode); -// TS_INFO("TOT parser: pid=%#x, table_id=%#x, current_tot=%p, len=%d", -// header->pid, tot->table_id, current_tot, payload_len); - if (current_tot) { current_tot->section_length = tot->section_length; current_tot->_utc3_time = tot->_utc3_time; @@ -187,6 +184,8 @@ tot_create_ut3c_time(tot); descriptors_parse(&payload[10], num_descriptors, tot->dentry, priv); } else { + TS_INFO("TOT parser: pid=%#x, table_id=%#x, current_tot=%p, len=%d", + header->pid, tot->table_id, current_tot, payload_len); tot_create_directory(header, tot, priv); descriptors_parse(&payload[10], num_descriptors, tot->dentry, priv); hashtable_add(priv->psi_tables, tot->dentry->inode, tot, (hashtable_free_function_t) tot_free); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-31 18:24:02
|
Revision: 404 http://sourceforge.net/p/demuxfs/code/404 Author: lucasvr Date: 2014-07-31 18:24:00 +0000 (Thu, 31 Jul 2014) Log Message: ----------- We do care about PES objects, so parse them by default. Modified Paths: -------------- src/mount.sh Modified: src/mount.sh =================================================================== --- src/mount.sh 2014-07-31 18:23:28 UTC (rev 403) +++ src/mount.sh 2014-07-31 18:24:00 UTC (rev 404) @@ -59,7 +59,7 @@ local backend=$PWD/backends/.libs/liblinuxdvb.so.0.0.0 valgrind_run_gdb \ ./demuxfs \ - -o parse_pes=0 \ + -o parse_pes=1 \ -o backend=$backend \ -o frequency=$frequency \ -f \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-31 18:23:30
|
Revision: 403 http://sourceforge.net/p/demuxfs/code/403 Author: lucasvr Date: 2014-07-31 18:23:28 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Use standard FIFO objects by default. Modified Paths: -------------- src/Makefile.am Modified: src/Makefile.am =================================================================== --- src/Makefile.am 2014-07-10 20:13:37 UTC (rev 402) +++ src/Makefile.am 2014-07-31 18:23:28 UTC (rev 403) @@ -4,9 +4,9 @@ noinst_LTLIBRARIES = libdemuxfs.la libdemuxfs_la_SOURCES = demuxfs.c ts.c snapshot.c fsutils.c hash.c xattr.c buffer.c crc32.c #if USE_POSIX_FIFOS -#libdemuxfs_la_SOURCES += fifo_posix.c +libdemuxfs_la_SOURCES += fifo_posix.c #else -libdemuxfs_la_SOURCES += fifo_generic.c +#libdemuxfs_la_SOURCES += fifo_generic.c #endif libdemuxfs_la_DEPENDENCIES = tables/libtables.la libdemuxfs_la_LIBADD = tables/libtables.la This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-10 20:13:40
|
Revision: 402 http://sourceforge.net/p/demuxfs/code/402 Author: lucasvr Date: 2014-07-10 20:13:37 +0000 (Thu, 10 Jul 2014) Log Message: ----------- Introduce TS_VERBOSE for debugging messages. Modified Paths: -------------- src/tables/descriptors/descriptors.c src/ts.h Modified: src/tables/descriptors/descriptors.c =================================================================== --- src/tables/descriptors/descriptors.c 2014-07-01 20:31:51 UTC (rev 401) +++ src/tables/descriptors/descriptors.c 2014-07-10 20:13:37 UTC (rev 402) @@ -41,15 +41,15 @@ uint8_t descriptor_length = payload[offset+1]; struct descriptor *d = descriptors_find(descriptor_tag, priv); if (! d) { - TS_WARNING("invalid descriptor tag %#x", descriptor_tag); + TS_WARNING("Invalid descriptor tag %#04x", descriptor_tag); offset += 2 + descriptor_length; continue; } - dprintf("Calling parser for descriptor %#4x-%s (descriptor %d/%d)", + TS_VERBOSE("Parsing descriptor %#04x-%s (#%d/%d)", descriptor_tag, d->name, n+1, num_descriptors); ret = d->parser(&payload[offset], descriptor_length, parent, priv); if (ret < 0) - TS_WARNING("error parsing descriptor tag %#x: %s", descriptor_tag, + TS_WARNING("Error parsing descriptor tag %#x: %s", descriptor_tag, strerror(-ret)); offset += 2 + descriptor_length; } Modified: src/ts.h =================================================================== --- src/ts.h 2014-07-01 20:31:51 UTC (rev 401) +++ src/ts.h 2014-07-10 20:13:37 UTC (rev 402) @@ -4,8 +4,9 @@ #include "colors.h" #define TS_WARNING(x...) dprintf(colorYellow "WARNING: " colorWhite x) -#define TS_ERROR(x...) dprintf(colorBoldRed "ERROR: " colorWhite x) -#define TS_INFO(x...) dprintf(colorBoldGreen "INFO: " colorWhite x) +#define TS_ERROR(x...) dprintf(colorBoldRed "ERROR: " colorWhite x) +#define TS_INFO(x...) dprintf(colorBoldGreen "INFO: " colorWhite x) +#define TS_VERBOSE(x...) dprintf(colorBrown "DEBUG: " colorGray x) #define TS_SYNC_BYTE 0x47 #define TS_MAX_SECTION_LENGTH 0x03FD This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-01 20:31:53
|
Revision: 401 http://sourceforge.net/p/demuxfs/code/401 Author: lucasvr Date: 2014-07-01 20:31:51 +0000 (Tue, 01 Jul 2014) Log Message: ----------- Introduce colors to ease the identification of special messages. Modified Paths: -------------- src/demuxfs.h src/dsm-cc/ait.c src/dsm-cc/ddb.c src/dsm-cc/dii.c src/dsm-cc/dsi.c src/tables/eit.c src/tables/nit.c src/tables/pat.c src/tables/pes.c src/tables/pmt.c src/tables/sdt.c src/tables/sdtt.c src/tables/tot.c src/ts.h Added Paths: ----------- src/colors.h Added: src/colors.h =================================================================== --- src/colors.h (rev 0) +++ src/colors.h 2014-07-01 20:31:51 UTC (rev 401) @@ -0,0 +1,16 @@ +#ifndef __COLORS_H +#define __COLORS_H + +#define colorGray "\033[1;30m" +#define colorBoldBlue "\033[1;34m" +#define colorBrown "\033[33m" +#define colorWhite "\033[37m" +#define colorYellow "\033[1;33m" +#define colorBoldGreen "\033[1;32m" +#define colorBoldRed "\033[1;31m" +#define colorCyan "\033[36m" +#define colorBoldCyan "\033[1;36m" +#define colorRedWhite "\033[41;37m" +#define colorNormal "\033[0m" + +#endif /* __COLORS_H */ Modified: src/demuxfs.h =================================================================== --- src/demuxfs.h 2014-07-01 19:53:12 UTC (rev 400) +++ src/demuxfs.h 2014-07-01 20:31:51 UTC (rev 401) @@ -24,10 +24,11 @@ #include "list.h" #include "priv.h" +#include "colors.h" #define dprintf(x...) do { \ - fprintf(stderr, "%s:%s:%d ", __FILE__, __FUNCTION__, __LINE__); \ fprintf(stderr, x); \ + fprintf(stderr, colorGray " (%s:%s:%d)" colorNormal, __FILE__, __FUNCTION__, __LINE__); \ fprintf(stderr, "\n"); \ } while(0) Modified: src/dsm-cc/ait.c =================================================================== --- src/dsm-cc/ait.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/dsm-cc/ait.c 2014-07-01 20:31:51 UTC (rev 401) @@ -674,7 +674,7 @@ return 0; } - dprintf("*** AIT parser: pid=%#x, table_id=%#x, current_ait=%p, ait->version_number=%#x, len=%d ***", + TS_INFO("AIT parser: pid=%#x, table_id=%#x, current_ait=%p, ait->version_number=%#x, len=%d", header->pid, ait->table_id, current_ait, ait->version_number, payload_len); /* Parse AIT specific bits */ Modified: src/dsm-cc/ddb.c =================================================================== --- src/dsm-cc/ddb.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/dsm-cc/ddb.c 2014-07-01 20:31:51 UTC (rev 401) @@ -157,7 +157,7 @@ return 0; } -// dprintf("*** DDB parser: pid=%d, table_id=%#x, ddb->version_number=%#x, ddb->block_number=%d, module_id=%d, current=%p ***", +// TS_INFO("DDB parser: pid=%d, table_id=%#x, ddb->version_number=%#x, ddb->block_number=%d, module_id=%d, current=%p", // header->pid, ddb->table_id, ddb->version_number, ddb->block_number, ddb->module_id, current_ddb); /* Create filesystem entries for this table */ Modified: src/dsm-cc/dii.c =================================================================== --- src/dsm-cc/dii.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/dsm-cc/dii.c 2014-07-01 20:31:51 UTC (rev 401) @@ -353,7 +353,7 @@ return 0; } - dprintf("*** DII parser: pid=%#x, table_id=%#x, dii->version_number=%#x, transaction_nr=%#x ***", + TS_INFO("DII parser: pid=%#x, table_id=%#x, dii->version_number=%#x, transaction_nr=%#x", header->pid, dii->table_id, dii->version_number, msg_header->transaction_id & ~0x80000000); /** Parse DII bits */ Modified: src/dsm-cc/dsi.c =================================================================== --- src/dsm-cc/dsi.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/dsm-cc/dsi.c 2014-07-01 20:31:51 UTC (rev 401) @@ -195,7 +195,7 @@ return 0; } - dprintf("*** DSI parser: pid=%#x, table_id=%#x, dsi->version_number=%#x, transaction_nr=%#x ***", + TS_INFO("DSI parser: pid=%#x, table_id=%#x, dsi->version_number=%#x, transaction_nr=%#x", header->pid, dsi->table_id, dsi->version_number, msg_header->transaction_id & ~0x80000000); /* Create filesystem entries for this table */ Modified: src/tables/eit.c =================================================================== --- src/tables/eit.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/eit.c 2014-07-01 20:31:51 UTC (rev 401) @@ -93,7 +93,7 @@ else if (header->pid == 0x27) eit_dir = CREATE_DIRECTORY(priv->root, FS_L_EIT_NAME); else { - dprintf("Unexpected EIT PID %#x!", header->pid); + TS_WARNING("Unexpected EIT PID %#x!", header->pid); eit_dir = CREATE_DIRECTORY(priv->root, "EIT"); } @@ -143,7 +143,7 @@ return 0; } - dprintf("*** EIT parser: pid=%#x, table_id=%#x, current_eit=%p, eit->version_number=%#x, len=%d ***", + TS_INFO("EIT parser: pid=%#x, table_id=%#x, current_eit=%p, eit->version_number=%#x, len=%d", header->pid, eit->table_id, current_eit, eit->version_number, payload_len); /* Parse EIT specific bits */ @@ -192,7 +192,7 @@ int loop_length = this_event->descriptors_loop_length; while (loop_length > 0) { - uint16_t desc_length = descriptors_parse(&payload[i], 1, event_dentry, priv); + uint32_t desc_length = descriptors_parse(&payload[i], 1, event_dentry, priv); loop_length -= desc_length; i += desc_length; } Modified: src/tables/nit.c =================================================================== --- src/tables/nit.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/nit.c 2014-07-01 20:31:51 UTC (rev 401) @@ -88,7 +88,7 @@ return 0; } - dprintf("*** NIT parser: pid=%#x, table_id=%#x, current_nit=%p, nit->version_number=%#x, len=%d ***", + TS_INFO("NIT parser: pid=%#x, table_id=%#x, current_nit=%p, nit->version_number=%#x, len=%d", header->pid, nit->table_id, current_nit, nit->version_number, payload_len); /* TODO: check payload boundaries */ Modified: src/tables/pat.c =================================================================== --- src/tables/pat.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/pat.c 2014-07-01 20:31:51 UTC (rev 401) @@ -146,7 +146,7 @@ free(pat); return 0; } - dprintf("*** PAT parser: pid=%#x, table_id=%#x, current_pat=%p, pat->version_number=%#x, len=%d ***", + TS_INFO("PAT parser: pid=%#x, table_id=%#x, current_pat=%p, pat->version_number=%#x, len=%d", header->pid, pat->table_id, current_pat, pat->version_number, payload_len); /* Parse PAT specific bits */ Modified: src/tables/pes.c =================================================================== --- src/tables/pes.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/pes.c 2014-07-01 20:31:51 UTC (rev 401) @@ -203,7 +203,7 @@ } if (offset > payload_len) { - dprintf("Error: offset(%d) > payload_len(%d)", offset, payload_len); + TS_ERROR("Video PES offset(%d) > payload_len(%d)", offset, payload_len); return -1; } Modified: src/tables/pmt.c =================================================================== --- src/tables/pmt.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/pmt.c 2014-07-01 20:31:51 UTC (rev 401) @@ -201,7 +201,7 @@ hashtable_add(priv->pes_parsers, stream->elementary_stream_pid, pes_parse_video, NULL); } else if (! hashtable_get(priv->pes_parsers, stream->elementary_stream_pid)) { /* Assign this to the PES generic parser */ - dprintf("Will parse pid %#x / stream_type %#x using a generic PES parser", + TS_INFO("Will parse pid %#x / stream_type %#x using a generic PES parser", stream->elementary_stream_pid, stream->stream_type_identifier); hashtable_add(priv->psi_parsers, stream->elementary_stream_pid, pes_parse_other, NULL); } @@ -253,7 +253,7 @@ return 0; } - dprintf("*** PMT parser: pid=%#x, table_id=%#x, current_pmt=%p, pmt->version_number=%#x, len=%d ***", + TS_INFO("PMT parser: pid=%#x, table_id=%#x, current_pmt=%p, pmt->version_number=%#x, len=%d", header->pid, pmt->table_id, current_pmt, pmt->version_number, payload_len); /* Parse PMT specific bits */ Modified: src/tables/sdt.c =================================================================== --- src/tables/sdt.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/sdt.c 2014-07-01 20:31:51 UTC (rev 401) @@ -106,7 +106,7 @@ return 0; } - dprintf("*** SDT parser: pid=%#x, table_id=%#x, current_sdt=%p, sdt->version_number=%#x, len=%d ***", + TS_INFO("SDT parser: pid=%#x, table_id=%#x, current_sdt=%p, sdt->version_number=%#x, len=%d", header->pid, sdt->table_id, current_sdt, sdt->version_number, payload_len); /* Parse SDT specific bits */ Modified: src/tables/sdtt.c =================================================================== --- src/tables/sdtt.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/sdtt.c 2014-07-01 20:31:51 UTC (rev 401) @@ -113,7 +113,7 @@ return 0; } - dprintf("*** SDTT parser: pid=%#x, table_id=%#x, current_sdtt=%p, sdtt->version_number=%#x, len=%d ***", + TS_INFO("SDTT parser: pid=%#x, table_id=%#x, current_sdtt=%p, sdtt->version_number=%#x, len=%d", header->pid, sdtt->table_id, current_sdtt, sdtt->version_number, payload_len); /* Parse SDTT specific bits */ Modified: src/tables/tot.c =================================================================== --- src/tables/tot.c 2014-07-01 19:53:12 UTC (rev 400) +++ src/tables/tot.c 2014-07-01 20:31:51 UTC (rev 401) @@ -171,7 +171,7 @@ tot->dentry->inode = TS_PACKET_HASH_KEY(header, tot); current_tot = hashtable_get(priv->psi_tables, tot->dentry->inode); -// dprintf("*** TOT parser: pid=%#x, table_id=%#x, current_tot=%p, len=%d ***", +// TS_INFO("TOT parser: pid=%#x, table_id=%#x, current_tot=%p, len=%d", // header->pid, tot->table_id, current_tot, payload_len); if (current_tot) { Modified: src/ts.h =================================================================== --- src/ts.h 2014-07-01 19:53:12 UTC (rev 400) +++ src/ts.h 2014-07-01 20:31:51 UTC (rev 401) @@ -1,10 +1,12 @@ #ifndef __ts_h #define __ts_h -#define TS_WARNING(x...) dprintf("WARNING: " x) -#define TS_ERROR(x...) dprintf("ERROR: " x) -#define TS_INFO(x...) dprintf("INFO: " x) +#include "colors.h" +#define TS_WARNING(x...) dprintf(colorYellow "WARNING: " colorWhite x) +#define TS_ERROR(x...) dprintf(colorBoldRed "ERROR: " colorWhite x) +#define TS_INFO(x...) dprintf(colorBoldGreen "INFO: " colorWhite x) + #define TS_SYNC_BYTE 0x47 #define TS_MAX_SECTION_LENGTH 0x03FD #define TS_LAST_TABLE_ID 0xBF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-01 19:53:20
|
Revision: 400 http://sourceforge.net/p/demuxfs/code/400 Author: lucasvr Date: 2014-07-01 19:53:12 +0000 (Tue, 01 Jul 2014) Log Message: ----------- Fixes potential integer overflow when more than 1 descriptor is passed to descriptors_parse()/dsmcc_descriptors_parse(). Modified Paths: -------------- src/dsm-cc/ait.c src/dsm-cc/descriptors/descriptors.c src/dsm-cc/descriptors/descriptors.h src/dsm-cc/dii.c src/tables/descriptors/descriptors.c src/tables/descriptors/descriptors.h src/tables/pmt.c Modified: src/dsm-cc/ait.c =================================================================== --- src/dsm-cc/ait.c 2014-07-01 18:17:59 UTC (rev 399) +++ src/dsm-cc/ait.c 2014-07-01 19:53:12 UTC (rev 400) @@ -686,7 +686,7 @@ CREATE_FILE_NUMBER(version_dentry, ait, common_descriptors_length); uint16_t i; - uint8_t len = 0; + uint32_t len = 0; for (i=10; i<10+ait->common_descriptors_length; i+=len) len = dsmcc_descriptors_parse(&payload[i], 1, version_dentry, priv); Modified: src/dsm-cc/descriptors/descriptors.c =================================================================== --- src/dsm-cc/descriptors/descriptors.c 2014-07-01 18:17:59 UTC (rev 399) +++ src/dsm-cc/descriptors/descriptors.c 2014-07-01 19:53:12 UTC (rev 400) @@ -30,12 +30,12 @@ #include "descriptors.h" #include "ts.h" -uint8_t dsmcc_descriptors_parse(const char *payload, uint8_t num_descriptors, +uint32_t dsmcc_descriptors_parse(const char *payload, uint8_t num_descriptors, struct dentry *parent, struct demuxfs_data *priv) { int ret; uint8_t n; - uint8_t offset = 0; + uint32_t offset = 0; for (n=0; n<num_descriptors; ++n) { uint8_t descriptor_tag = payload[offset]; uint8_t descriptor_length = payload[offset+1]; Modified: src/dsm-cc/descriptors/descriptors.h =================================================================== --- src/dsm-cc/descriptors/descriptors.h 2014-07-01 18:17:59 UTC (rev 399) +++ src/dsm-cc/descriptors/descriptors.h 2014-07-01 19:53:12 UTC (rev 400) @@ -12,7 +12,7 @@ struct dsmcc_descriptor *dsmcc_descriptors_init(struct demuxfs_data *priv); void dsmcc_descriptors_destroy(struct dsmcc_descriptor *descriptor_list); struct dsmcc_descriptor *dsmcc_descriptors_find(uint8_t tag, struct demuxfs_data *priv); -uint8_t dsmcc_descriptors_parse(const char *payload, uint8_t num_descriptors, +uint32_t dsmcc_descriptors_parse(const char *payload, uint8_t num_descriptors, struct dentry *parent, struct demuxfs_data *priv); /* Descriptor parsers */ Modified: src/dsm-cc/dii.c =================================================================== --- src/dsm-cc/dii.c 2014-07-01 18:17:59 UTC (rev 399) +++ src/dsm-cc/dii.c 2014-07-01 19:53:12 UTC (rev 400) @@ -141,8 +141,8 @@ CREATE_FILE_BIN(parent, dii, private_data_bytes, dii->private_data_length); #if 0 if (dii->private_data_length) { - uint8_t len; - uint16_t offset = 0; + uint32_t len; + uint32_t offset = 0; while (offset < dii->private_data_length) { len = dsmcc_descriptors_parse(&dii->private_data_bytes[offset], 1, parent, priv); offset += len + 2; Modified: src/tables/descriptors/descriptors.c =================================================================== --- src/tables/descriptors/descriptors.c 2014-07-01 18:17:59 UTC (rev 399) +++ src/tables/descriptors/descriptors.c 2014-07-01 19:53:12 UTC (rev 400) @@ -30,12 +30,12 @@ #include "descriptors.h" #include "ts.h" -uint8_t descriptors_parse(const char *payload, uint8_t num_descriptors, +uint32_t descriptors_parse(const char *payload, uint8_t num_descriptors, struct dentry *parent, struct demuxfs_data *priv) { int ret; uint8_t n; - uint8_t offset = 0; + uint32_t offset = 0; for (n=0; n<num_descriptors; ++n) { uint8_t descriptor_tag = payload[offset]; uint8_t descriptor_length = payload[offset+1]; @@ -45,8 +45,8 @@ offset += 2 + descriptor_length; continue; } - //dprintf("Calling parser for descriptor %#4x-%s (descriptor %d/%d)", - // descriptor_tag, d->name, n+1, num_descriptors); + dprintf("Calling parser for descriptor %#4x-%s (descriptor %d/%d)", + descriptor_tag, d->name, n+1, num_descriptors); ret = d->parser(&payload[offset], descriptor_length, parent, priv); if (ret < 0) TS_WARNING("error parsing descriptor tag %#x: %s", descriptor_tag, Modified: src/tables/descriptors/descriptors.h =================================================================== --- src/tables/descriptors/descriptors.h 2014-07-01 18:17:59 UTC (rev 399) +++ src/tables/descriptors/descriptors.h 2014-07-01 19:53:12 UTC (rev 400) @@ -15,7 +15,7 @@ void descriptors_destroy(struct descriptor *descriptor_list); struct descriptor *descriptors_find(uint8_t tag, struct demuxfs_data *priv); int descriptors_count(const char *payload, uint16_t program_information_length); -uint8_t descriptors_parse(const char *payload, uint8_t num_descriptors, +uint32_t descriptors_parse(const char *payload, uint8_t num_descriptors, struct dentry *parent, struct demuxfs_data *priv); /* Descriptor parsers */ Modified: src/tables/pmt.c =================================================================== --- src/tables/pmt.c 2014-07-01 18:17:59 UTC (rev 399) +++ src/tables/pmt.c 2014-07-01 19:53:12 UTC (rev 400) @@ -265,10 +265,10 @@ pmt->num_descriptors = descriptors_count(&payload[12], pmt->program_information_length); pmt_create_directory(header, pmt, &version_dentry, priv); - uint8_t descriptors_len = descriptors_parse(&payload[12], pmt->num_descriptors, + uint32_t descriptors_len = descriptors_parse(&payload[12], pmt->num_descriptors, version_dentry, priv); - uint8_t offset = 12 + descriptors_len; + uint32_t offset = 12 + descriptors_len; pmt->num_programs = 0; while (offset < 3 + pmt->section_length - sizeof(pmt->crc)) { struct pmt_stream stream; @@ -278,7 +278,7 @@ stream.reserved_2 = (payload[offset+3] >> 4) & 0x0f; stream.es_information_length = CONVERT_TO_16(payload[offset+3], payload[offset+4]) & 0x0fff; - uint16_t es_i = 0; + uint32_t es_i = 0; if (! stream.es_information_length) { struct dentry *subdir = NULL; pmt_populate_stream_dir(&stream, NULL, version_dentry, &subdir, priv); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-01 18:18:08
|
Revision: 399 http://sourceforge.net/p/demuxfs/code/399 Author: lucasvr Date: 2014-07-01 18:17:59 +0000 (Tue, 01 Jul 2014) Log Message: ----------- Helper script to tune to specific broadcasters from Sao Paulo/SP, Brazil. Added Paths: ----------- src/mount.sh Added: src/mount.sh =================================================================== --- src/mount.sh (rev 0) +++ src/mount.sh 2014-07-01 18:17:59 UTC (rev 399) @@ -0,0 +1,72 @@ +#!/bin/bash + +function valgrind_run_gdb() +{ + VALGRIND_LOGFILE=/tmp/demuxfs-valgrind.log + DEMUXFS_LOGFILE=/tmp/demuxfs-run.log + VALGRIND_SUPRESSIONS_FILE=supressions.txt + + [ ! -e $VALGRIND_SUPRESSIONS_FILE ] && touch $VALGRIND_SUPRESSIONS_FILE + rm -f $VALGRIND_LOGFILE + valgrind \ + --leak-check=full \ + --leak-resolution=high \ + --show-reachable=yes \ + --trace-children=no \ + --db-attach=yes \ + --gen-suppressions=yes \ + --suppressions=$VALGRIND_SUPRESSIONS_FILE \ + $@ +} + +function playFromFrontend() +{ + local frequency= + local channels_saopaulo=( + "479142857:Mega TV" + "491142857:TV Gazeta" + "497142857:Globo SP" + "509142857:Rede Record" + "521142857:Rede 21" + "527142857:Band" + "533142857:TV Cultura" + "545142857:CNT Americana" + "557142857:SBT SP" + "563142857:Rede TV" + "569142857:RIT" + "575142857:Ideal TV" + "587142857:Top TV" + "623142857:Rede Vida" + "635142857:TV Aparecida" + "647142857:Record News" + "671142857:NGT" + "683142857:Terra Viva" + "719142857:TVZ" + "725142857:Rede Brasil de Televisao" + "749142857:TV Mackenzie" + "755142857:TV Camara" + "767142857:TV Brasil" + "773142857:TV Justica" + ) + + options=`for i in "${channels_saopaulo[@]}"; do + freq=$(echo -n "$i" | cut -d: -f1); + name=$(echo -n "$i" | cut -d: -f2 | sed 's, ,_,g'); + echo -n "$freq" "$name "; + done` + frequency=`dialog --stdout --title 'Channel list' --menu 'Select broadcaster' 0 0 0 $options` + + local backend=$PWD/backends/.libs/liblinuxdvb.so.0.0.0 + valgrind_run_gdb \ + ./demuxfs \ + -o parse_pes=0 \ + -o backend=$backend \ + -o frequency=$frequency \ + -f \ + $@ \ + ~/Mount +} + +ulimit -c unlimited +fusermount -u ~/Mount 2> /dev/null +playFromFrontend $@ Property changes on: src/mount.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-01 17:51:39
|
Revision: 398 http://sourceforge.net/p/demuxfs/code/398 Author: lucasvr Date: 2014-07-01 17:51:36 +0000 (Tue, 01 Jul 2014) Log Message: ----------- Fixes a series of potential buffer underflow errors due to the use of unsigned variables. Modified Paths: -------------- src/dsm-cc/ait.c src/dsm-cc/biop.c src/tables/descriptors/descriptors.c src/tables/eit.c src/ts.c Modified: src/dsm-cc/ait.c =================================================================== --- src/dsm-cc/ait.c 2014-07-01 17:46:26 UTC (rev 397) +++ src/dsm-cc/ait.c 2014-07-01 17:51:36 UTC (rev 398) @@ -261,7 +261,7 @@ } CREATE_FILE_STRING(dentry, &desc, protocol_id, XATTR_FORMAT_STRING_AND_NUMBER); CREATE_FILE_NUMBER(dentry, &desc, transport_protocol_label); - if ((len - 3) > 0) { + if (((int) len - 3) > 0) { uint8_t i = 0; uint8_t url_number = 1; struct dentry *subdir; Modified: src/dsm-cc/biop.c =================================================================== --- src/dsm-cc/biop.c 2014-07-01 17:46:26 UTC (rev 397) +++ src/dsm-cc/biop.c 2014-07-01 17:51:36 UTC (rev 398) @@ -497,7 +497,7 @@ j += biop_parse_object_location(&pb->object_location, &buf[j], len-j); j += biop_parse_connbinder(&pb->connbinder, &buf[j], len-j); - if (pb->component_count-2 > 0) { + if ((int) pb->component_count-2 > 0) { dprintf("component_count=%d, but LiteOptionsComponent() parser is not implemented.", pb->component_count); } Modified: src/tables/descriptors/descriptors.c =================================================================== --- src/tables/descriptors/descriptors.c 2014-07-01 17:46:26 UTC (rev 397) +++ src/tables/descriptors/descriptors.c 2014-07-01 17:51:36 UTC (rev 398) @@ -69,14 +69,14 @@ int descriptors_count(const char *payload, uint16_t info_length) { - int num = 0; + int num = 0, len = (int) info_length; const char *p = payload; - while (info_length > 0) { - if (info_length < 2) + while (len > 0) { + if (len < 2) return 0; - if (info_length < 2 + p[1]) + if (len < 2 + p[1]) return 0; - info_length -= 2 + p[1]; + len -= 2 + p[1]; p += 2 + p[1]; num++; } Modified: src/tables/eit.c =================================================================== --- src/tables/eit.c 2014-07-01 17:46:26 UTC (rev 397) +++ src/tables/eit.c 2014-07-01 17:51:36 UTC (rev 398) @@ -190,7 +190,7 @@ CREATE_FILE_NUMBER(event_dentry, this_event, free_ca_mode); CREATE_FILE_NUMBER(event_dentry, this_event, descriptors_loop_length); - uint16_t loop_length = this_event->descriptors_loop_length; + int loop_length = this_event->descriptors_loop_length; while (loop_length > 0) { uint16_t desc_length = descriptors_parse(&payload[i], 1, event_dentry, priv); loop_length -= desc_length; Modified: src/ts.c =================================================================== --- src/ts.c 2014-07-01 17:46:26 UTC (rev 397) +++ src/ts.c 2014-07-01 17:51:36 UTC (rev 398) @@ -246,7 +246,7 @@ return -ENOBUFS; } section_length = CONVERT_TO_16(start[1], start[2]) & 0x0fff; - if (pointer_field > 0) { + if ((int) pointer_field > 0) { end = payload_start + pointer_field; } else { is_new_packet = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-07-01 17:46:29
|
Revision: 397 http://sourceforge.net/p/demuxfs/code/397 Author: lucasvr Date: 2014-07-01 17:46:26 +0000 (Tue, 01 Jul 2014) Log Message: ----------- Ensure that all members of the structures allocated are reset. Modified Paths: -------------- src/backends/linuxdvb.c Modified: src/backends/linuxdvb.c =================================================================== --- src/backends/linuxdvb.c 2014-06-30 14:36:44 UTC (rev 396) +++ src/backends/linuxdvb.c 2014-07-01 17:46:26 UTC (rev 397) @@ -242,6 +242,7 @@ } struct dmx_pes_filter_params pes_filter; + memset(&pes_filter, 0, sizeof(pes_filter)); pes_filter.pid = 0x2000; pes_filter.input = DMX_IN_FRONTEND; pes_filter.output = DMX_OUT_TS_TAP; @@ -302,6 +303,7 @@ struct dtv_properties varname; \ struct dtv_property varname ## _ ## command; \ memset(&varname, 0, sizeof(varname)); \ + memset(&varname ## _ ## command, 0, sizeof(varname ## _ ## command)); \ varname.num = 1; \ varname.props = &varname ## _ ## command; \ varname.props[0].cmd = command @@ -473,9 +475,9 @@ PUSH_PROPERTY(new_prop, idx++, DTV_DELIVERY_SYSTEM, delivery); PUSH_PROPERTY(new_prop, idx++, DTV_FREQUENCY, p->frequency); PUSH_PROPERTY(new_prop, idx++, DTV_BANDWIDTH_HZ, BANDWIDTH_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_INVERSION, INVERSION_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_GUARD_INTERVAL, GUARD_INTERVAL_AUTO); PUSH_PROPERTY(new_prop, idx++, DTV_TRANSMISSION_MODE, TRANSMISSION_MODE_AUTO); - PUSH_PROPERTY(new_prop, idx++, DTV_GUARD_INTERVAL, GUARD_INTERVAL_AUTO); - PUSH_PROPERTY(new_prop, idx++, DTV_INVERSION, INVERSION_AUTO); switch (delivery) { // OFDM delivery type This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-06-30 14:36:48
|
Revision: 396 http://sourceforge.net/p/demuxfs/code/396 Author: lucasvr Date: 2014-06-30 14:36:44 +0000 (Mon, 30 Jun 2014) Log Message: ----------- Automake 1.12 requires AM_PROG_AR, but previous versions of Automake does not recognize AM_PROG_AR as a valid entry. Modified Paths: -------------- configure.ac Modified: configure.ac =================================================================== --- configure.ac 2014-06-26 15:16:33 UTC (rev 395) +++ configure.ac 2014-06-30 14:36:44 UTC (rev 396) @@ -5,7 +5,7 @@ AC_INIT([DEMUXFS], [0.1], [lu...@go...]) AC_CONFIG_AUX_DIR([build-aux]) AC_PROG_CC_C99 -AM_PROG_AR +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_LIBTOOL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-06-26 15:16:39
|
Revision: 395 http://sourceforge.net/p/demuxfs/code/395 Author: lucasvr Date: 2014-06-26 15:16:33 +0000 (Thu, 26 Jun 2014) Log Message: ----------- Check if the file descriptor is valid before issuing an ioctl. Modified Paths: -------------- src/backends/linuxdvb.c Modified: src/backends/linuxdvb.c =================================================================== --- src/backends/linuxdvb.c 2014-06-26 14:35:37 UTC (rev 394) +++ src/backends/linuxdvb.c 2014-06-26 15:16:33 UTC (rev 395) @@ -338,6 +338,9 @@ struct input_parser *p = priv->parser; int ret; + if (p->frontend_fd < 0) + return 0; + DECLARE_PROPERTY(properties, DTV_API_VERSION); ret = ioctl(p->frontend_fd, FE_GET_PROPERTY, &properties); if (ret == 0 && (properties.props[0].u.data & 0x500) == 0x500) { @@ -622,13 +625,13 @@ } struct backend_ops linuxdvb_backend_ops = { - .create = linuxdvb_create_parser, - .destroy = linuxdvb_destroy_parser, + .create = linuxdvb_create_parser, + .destroy = linuxdvb_destroy_parser, .set_frequency = linuxdvb_set_frequency, - .read = linuxdvb_read_packet, - .process = linuxdvb_process_packet, - .keep_alive = linuxdvb_keep_alive, - .usage = linuxdvb_usage, + .read = linuxdvb_read_packet, + .process = linuxdvb_process_packet, + .keep_alive = linuxdvb_keep_alive, + .usage = linuxdvb_usage, }; struct backend_ops *backend_get_ops(void) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-06-26 14:35:40
|
Revision: 394 http://sourceforge.net/p/demuxfs/code/394 Author: lucasvr Date: 2014-06-26 14:35:37 +0000 (Thu, 26 Jun 2014) Log Message: ----------- Use the u.data member to set DTV properties. Modified Paths: -------------- src/backends/linuxdvb.c Modified: src/backends/linuxdvb.c =================================================================== --- src/backends/linuxdvb.c 2014-06-25 22:12:45 UTC (rev 393) +++ src/backends/linuxdvb.c 2014-06-26 14:35:37 UTC (rev 394) @@ -300,12 +300,36 @@ #define DECLARE_PROPERTY(varname,command) \ struct dtv_properties varname; \ - struct dtv_property command_property; \ - memset(&properties, 0, sizeof(properties)); \ - properties.num = 1; \ - properties.props = &command_property; \ - properties.props[0].cmd = command + struct dtv_property varname ## _ ## command; \ + memset(&varname, 0, sizeof(varname)); \ + varname.num = 1; \ + varname.props = &varname ## _ ## command; \ + varname.props[0].cmd = command +#define DECLARE_PROPERTIES(varname,n) \ + int varname ## _count = n; \ + struct dtv_properties varname; \ + struct dtv_property varname ## _props[varname ## _count]; \ + memset(&varname, 0, sizeof(varname)); \ + memset(varname ## _props, 0, sizeof(varname ## _props)); \ + varname.num = varname ## _count; \ + varname.props = varname ## _props + +#define PUSH_PROPERTY(varname,idx,command,value) do { \ + int varname ## _count = idx; \ + varname.props[varname ## _count].cmd = command; \ + varname.props[varname ## _count].u.data = value; \ +} while(0) + +#define UPDATE_PROPERTY(varname,command,value) do { \ + for (int p=0; p<varname.num; ++p) { \ + if (varname.props[p].cmd == command) { \ + varname.props[p].u.data = value; \ + break; \ + } \ + } \ +} while(0) + /** * linuxdvb_set_frequency: backend's set_frequency() method. */ @@ -428,64 +452,85 @@ static int linuxdvb_set_frequency_v5(uint32_t frequency, struct demuxfs_data *priv) { struct input_parser *p = priv->parser; - struct dvb_frontend_parameters params; fe_sec_voltage_t voltage; fe_sec_tone_mode_t tone; int ret; - - DECLARE_PROPERTY(properties, DTV_DELIVERY_SYSTEM); - ret = ioctl(p->frontend_fd, FE_GET_PROPERTY, &properties); + + DECLARE_PROPERTY(curr_prop, DTV_DELIVERY_SYSTEM); + ret = ioctl(p->frontend_fd, FE_GET_PROPERTY, &curr_prop); if (ret < 0) { perror("FE_GET_PROPERTY"); return -errno; } + int delivery = curr_prop.props[0].u.data; - memset(¶ms, 0, sizeof(params)); - params.frequency = p->frequency; - params.inversion = INVERSION_AUTO; + int idx = 0; + DECLARE_PROPERTIES(new_prop, 64); + PUSH_PROPERTY(new_prop, idx++, DTV_CLEAR, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_DELIVERY_SYSTEM, delivery); + PUSH_PROPERTY(new_prop, idx++, DTV_FREQUENCY, p->frequency); + PUSH_PROPERTY(new_prop, idx++, DTV_BANDWIDTH_HZ, BANDWIDTH_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_TRANSMISSION_MODE, TRANSMISSION_MODE_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_GUARD_INTERVAL, GUARD_INTERVAL_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_INVERSION, INVERSION_AUTO); - switch (properties.props[0].u.data) { + switch (delivery) { // OFDM delivery type + case SYS_ISDBT: + // Supported transmission modes: 8k, 4k, 2k. + // Supported bandwidths: 6MHz + UPDATE_PROPERTY(new_prop, DTV_BANDWIDTH_HZ, 6000000); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_SOUND_BROADCASTING, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_PARTIAL_RECEPTION, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYER_ENABLED, 7); // 0x1:LayerA, 0x2:LayerB, 0x4:LayerC + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_SB_SUBCHANNEL_ID, 0); // applies if SOUND_BROADCASTING=1 + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_SB_SEGMENT_IDX, 0); // applies if SOUND_BROADCASTING=1 + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_SB_SEGMENT_COUNT, 0); // applies if SOUND_BROADCASTING=1 + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERA_FEC, FEC_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERA_MODULATION, QAM_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERA_SEGMENT_COUNT, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERA_TIME_INTERLEAVING, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERB_FEC, FEC_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERB_MODULATION, QAM_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERB_SEGMENT_COUNT, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERB_TIME_INTERLEAVING, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERC_FEC, FEC_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERC_MODULATION, QAM_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERC_SEGMENT_COUNT, 0); + PUSH_PROPERTY(new_prop, idx++, DTV_ISDBT_LAYERC_TIME_INTERLEAVING, 0); + break; case SYS_DVBT: case SYS_DVBT2: case SYS_DVBH: - case SYS_ISDBT: - params.u.ofdm.bandwidth = BANDWIDTH_AUTO; - params.u.ofdm.code_rate_HP = FEC_AUTO; - params.u.ofdm.code_rate_LP = FEC_AUTO; - params.u.ofdm.constellation = QAM_AUTO; - params.u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO; - params.u.ofdm.guard_interval = GUARD_INTERVAL_AUTO; - params.u.ofdm.hierarchy_information = HIERARCHY_AUTO; + PUSH_PROPERTY(new_prop, idx++, DTV_MODULATION, QAM_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_SYMBOL_RATE, p->symbol_rate); + PUSH_PROPERTY(new_prop, idx++, DTV_HIERARCHY, HIERARCHY_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ROLLOFF, ROLLOFF_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_PILOT, PILOT_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_INNER_FEC, FEC_AUTO); break; + // QPSK delivery type case SYS_DSS: case SYS_DVBS: case SYS_DVBS2: case SYS_TURBO: - params.u.qpsk.symbol_rate = p->symbol_rate; - params.u.qpsk.fec_inner = FEC_AUTO; voltage = p->qpsk_voltage == 13 ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; tone = p->qpsk_tone == 0 ? SEC_TONE_OFF : SEC_TONE_ON; + PUSH_PROPERTY(new_prop, idx++, DTV_VOLTAGE, voltage); + PUSH_PROPERTY(new_prop, idx++, DTV_TONE, tone); + PUSH_PROPERTY(new_prop, idx++, DTV_MODULATION, QAM_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_SYMBOL_RATE, p->symbol_rate); + PUSH_PROPERTY(new_prop, idx++, DTV_HIERARCHY, HIERARCHY_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_ROLLOFF, ROLLOFF_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_PILOT, PILOT_AUTO); + PUSH_PROPERTY(new_prop, idx++, DTV_INNER_FEC, FEC_AUTO); + break; - ret = ioctl(p->frontend_fd, FE_SET_VOLTAGE, voltage); - if (ret < 0) { - perror("FE_SET_VOLTAGE"); - return -errno; - } - ret = ioctl(p->frontend_fd, FE_SET_TONE, tone); - if (ret < 0) { - perror("FE_SET_TONE"); - return -errno; - } - break; // QAM delivery type case SYS_DVBC_ANNEX_A: case SYS_DVBC_ANNEX_C: - params.inversion = INVERSION_OFF; - params.u.qam.symbol_rate = p->symbol_rate; - params.u.qam.fec_inner = FEC_AUTO; - params.u.qam.modulation = QAM_AUTO; + UPDATE_PROPERTY(new_prop, DTV_INVERSION, INVERSION_OFF); break; // ATSC delivery type case SYS_ATSC: @@ -493,24 +538,20 @@ /* Not tested */ break; default: - fprintf(stderr, "Unknown frontend type '%#x'\n", properties.props[0].u.data); + fprintf(stderr, "Unknown frontend type '%#x'\n", delivery); return -ECANCELED; } - fprintf(stderr, "Setting delivery type to %s\n", linuxdvb_delivery_type(properties.props[0].u.data)); - ret = ioctl(p->frontend_fd, FE_SET_PROPERTY, &properties); + PUSH_PROPERTY(new_prop, idx++, DTV_TUNE, 0); + + fprintf(stdout, "%s: setting frequency to %d...\n", linuxdvb_delivery_type(delivery), p->frequency); + new_prop.num = idx; + ret = ioctl(p->frontend_fd, FE_SET_PROPERTY, &new_prop); if (ret < 0) { perror("FE_SET_PROPERTY"); return -errno; } - fprintf(stdout, "Setting frequency to %d...\n", p->frequency); - ret = ioctl(p->frontend_fd, FE_SET_FRONTEND, ¶ms); - if (ret < 0) { - perror("FE_SET_FRONTEND"); - return -errno; - } - fe_status_t status; char fe_status[256]; while (true) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-06-25 22:12:47
|
Revision: 393 http://sourceforge.net/p/demuxfs/code/393 Author: lucasvr Date: 2014-06-25 22:12:45 +0000 (Wed, 25 Jun 2014) Log Message: ----------- Update to LinuxDVB API version 5 Modified Paths: -------------- src/backends/linuxdvb.c src/backends/linuxdvb.h Modified: src/backends/linuxdvb.c =================================================================== --- src/backends/linuxdvb.c 2014-06-25 22:11:39 UTC (rev 392) +++ src/backends/linuxdvb.c 2014-06-25 22:12:45 UTC (rev 393) @@ -42,6 +42,11 @@ #define LINUXDVB_DEFAULT_QPSK_VOLTAGE 13 #define LINUXDVB_DEFAULT_QPSK_TONE 0 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,0,0) +#undef DVB_API_VERSION +#define DVB_API_VERSION 5 +#endif + struct input_parser { char *frontend_device; char *demux_device; @@ -58,6 +63,9 @@ uint8_t packet_size; }; +static int linuxdvb_set_frequency_v3(uint32_t frequency, struct demuxfs_data *priv); +static int linuxdvb_set_frequency_v5(uint32_t frequency, struct demuxfs_data *priv); + /** * Command line parsing routines. */ @@ -99,6 +107,65 @@ return 1; } +#define TEST_AND_STRINGIFY(type) case type: return #type + +static const char *linuxdvb_delivery_type(int type) { + switch (type) { + TEST_AND_STRINGIFY(SYS_ATSC); + TEST_AND_STRINGIFY(SYS_DVBC_ANNEX_A); + TEST_AND_STRINGIFY(SYS_DVBC_ANNEX_B); + TEST_AND_STRINGIFY(SYS_DVBC_ANNEX_C); + TEST_AND_STRINGIFY(SYS_DVBH); + TEST_AND_STRINGIFY(SYS_DVBS); + TEST_AND_STRINGIFY(SYS_DVBS2); + TEST_AND_STRINGIFY(SYS_DVBT); + TEST_AND_STRINGIFY(SYS_DVBT2); + TEST_AND_STRINGIFY(SYS_DSS); + TEST_AND_STRINGIFY(SYS_ISDBT); + TEST_AND_STRINGIFY(SYS_TURBO); + default: return "UNKNOWN"; + } +} + +static void linuxdvb_get_frontend_status(int status, char *buf, size_t size) +{ + char *ptr = buf; + size_t count, n = size-1; + + memset(buf, 0, size); + if (status & FE_HAS_SIGNAL) { + count = snprintf(ptr, n, "HAS_SIGNAL,"); + ptr += count, n -= count; + } + if (status & FE_HAS_CARRIER) { + count = snprintf(ptr, n, "HAS_CARRIER,"); + ptr += count, n -= count; + if (status & FE_HAS_VITERBI) + count = snprintf(ptr, n, "HAS_VITERBI,"); + ptr += count, n -= count; + } + if (status & FE_HAS_SYNC) { + count = snprintf(ptr, n, "HAS_SYNC,"); + ptr += count, n -= count; + } + if (status & FE_HAS_LOCK) { + count = snprintf(ptr, n, "HAS_LOCK,"); + ptr += count, n -= count; + } + if (status & FE_TIMEDOUT) { + count = snprintf(ptr, n, "TIMEDOUT,"); + ptr += count, n -= count; + } + if (status & FE_REINIT) { + count = snprintf(ptr, n, "REINIT,"); + ptr += count, n -= count; + } + if (ptr == buf) + snprintf(ptr, n, "UNKNOWN"); + else + ptr[strlen(ptr)-1] = '\0'; +} + /** * linuxdvb_create_parser: backend's create() method. */ @@ -231,12 +298,36 @@ return 0; } +#define DECLARE_PROPERTY(varname,command) \ + struct dtv_properties varname; \ + struct dtv_property command_property; \ + memset(&properties, 0, sizeof(properties)); \ + properties.num = 1; \ + properties.props = &command_property; \ + properties.props[0].cmd = command + /** * linuxdvb_set_frequency: backend's set_frequency() method. */ int linuxdvb_set_frequency(uint32_t frequency, struct demuxfs_data *priv) { struct input_parser *p = priv->parser; + int ret; + + DECLARE_PROPERTY(properties, DTV_API_VERSION); + ret = ioctl(p->frontend_fd, FE_GET_PROPERTY, &properties); + if (ret == 0 && (properties.props[0].u.data & 0x500) == 0x500) { + fprintf(stderr, "APIv5\n"); + return linuxdvb_set_frequency_v5(frequency, priv); + } else { + fprintf(stderr, "APIv3\n"); + return linuxdvb_set_frequency_v3(frequency, priv); + } +} + +static int linuxdvb_set_frequency_v3(uint32_t frequency, struct demuxfs_data *priv) +{ + struct input_parser *p = priv->parser; struct dvb_frontend_parameters params; struct dvb_frontend_event event; struct dvb_frontend_info info; @@ -245,6 +336,7 @@ struct pollfd pollfd; int ret; + memset(&info, 0, sizeof(info)); ret = ioctl(p->frontend_fd, FE_GET_INFO, &info); if (ret < 0) { perror("FE_GET_INFO"); @@ -333,6 +425,113 @@ } } +static int linuxdvb_set_frequency_v5(uint32_t frequency, struct demuxfs_data *priv) +{ + struct input_parser *p = priv->parser; + struct dvb_frontend_parameters params; + fe_sec_voltage_t voltage; + fe_sec_tone_mode_t tone; + int ret; + + DECLARE_PROPERTY(properties, DTV_DELIVERY_SYSTEM); + ret = ioctl(p->frontend_fd, FE_GET_PROPERTY, &properties); + if (ret < 0) { + perror("FE_GET_PROPERTY"); + return -errno; + } + + memset(¶ms, 0, sizeof(params)); + params.frequency = p->frequency; + params.inversion = INVERSION_AUTO; + + switch (properties.props[0].u.data) { + // OFDM delivery type + case SYS_DVBT: + case SYS_DVBT2: + case SYS_DVBH: + case SYS_ISDBT: + params.u.ofdm.bandwidth = BANDWIDTH_AUTO; + params.u.ofdm.code_rate_HP = FEC_AUTO; + params.u.ofdm.code_rate_LP = FEC_AUTO; + params.u.ofdm.constellation = QAM_AUTO; + params.u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO; + params.u.ofdm.guard_interval = GUARD_INTERVAL_AUTO; + params.u.ofdm.hierarchy_information = HIERARCHY_AUTO; + break; + // QPSK delivery type + case SYS_DSS: + case SYS_DVBS: + case SYS_DVBS2: + case SYS_TURBO: + params.u.qpsk.symbol_rate = p->symbol_rate; + params.u.qpsk.fec_inner = FEC_AUTO; + voltage = p->qpsk_voltage == 13 ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; + tone = p->qpsk_tone == 0 ? SEC_TONE_OFF : SEC_TONE_ON; + + ret = ioctl(p->frontend_fd, FE_SET_VOLTAGE, voltage); + if (ret < 0) { + perror("FE_SET_VOLTAGE"); + return -errno; + } + ret = ioctl(p->frontend_fd, FE_SET_TONE, tone); + if (ret < 0) { + perror("FE_SET_TONE"); + return -errno; + } + break; + // QAM delivery type + case SYS_DVBC_ANNEX_A: + case SYS_DVBC_ANNEX_C: + params.inversion = INVERSION_OFF; + params.u.qam.symbol_rate = p->symbol_rate; + params.u.qam.fec_inner = FEC_AUTO; + params.u.qam.modulation = QAM_AUTO; + break; + // ATSC delivery type + case SYS_ATSC: + case SYS_DVBC_ANNEX_B: + /* Not tested */ + break; + default: + fprintf(stderr, "Unknown frontend type '%#x'\n", properties.props[0].u.data); + return -ECANCELED; + } + + fprintf(stderr, "Setting delivery type to %s\n", linuxdvb_delivery_type(properties.props[0].u.data)); + ret = ioctl(p->frontend_fd, FE_SET_PROPERTY, &properties); + if (ret < 0) { + perror("FE_SET_PROPERTY"); + return -errno; + } + + fprintf(stdout, "Setting frequency to %d...\n", p->frequency); + ret = ioctl(p->frontend_fd, FE_SET_FRONTEND, ¶ms); + if (ret < 0) { + perror("FE_SET_FRONTEND"); + return -errno; + } + + fe_status_t status; + char fe_status[256]; + while (true) { + ret = ioctl(p->frontend_fd, FE_READ_STATUS, &status); + if (ret < 0) { + perror("FE_READ_STATUS"); + return -errno; + } + if (status & FE_HAS_LOCK) { + fprintf(stderr, "Tuner successfully set to frequency %d\n", p->frequency); + return 0; + } + linuxdvb_get_frontend_status(status, fe_status, sizeof(fe_status)); + fprintf(stdout, "Waiting to get a lock on the frontend... (status=%s)\n", fe_status); + usleep(1000000); + } + + fprintf(stderr, "Timed out tuning to frequency %d\n", p->frequency); + return -ETIMEDOUT; +} + /** * linuxdvb_read_parser: backend's read() method. */ Modified: src/backends/linuxdvb.h =================================================================== --- src/backends/linuxdvb.h 2014-06-25 22:11:39 UTC (rev 392) +++ src/backends/linuxdvb.h 2014-06-25 22:12:45 UTC (rev 393) @@ -14,6 +14,7 @@ #include <sys/types.h> #include <linux/dvb/frontend.h> #include <linux/dvb/dmx.h> +#include <linux/version.h> #endif /* USE_LINUXDVB */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-06-25 22:11:43
|
Revision: 392 http://sourceforge.net/p/demuxfs/code/392 Author: lucasvr Date: 2014-06-25 22:11:39 +0000 (Wed, 25 Jun 2014) Log Message: ----------- Adjustments to build on FFMpeg 2.x.x Modified Paths: -------------- configure.ac src/main.c src/snapshot.c Modified: configure.ac =================================================================== --- configure.ac 2014-06-25 22:08:39 UTC (rev 391) +++ configure.ac 2014-06-25 22:11:39 UTC (rev 392) @@ -4,11 +4,11 @@ dnl AC_INIT([DEMUXFS], [0.1], [lu...@go...]) AC_CONFIG_AUX_DIR([build-aux]) +AC_PROG_CC_C99 +AM_PROG_AR AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -AC_PROG_CC_C99 AC_PROG_LIBTOOL - dnl dnl Check for LibFUSE (mandatory) dnl @@ -19,7 +19,7 @@ fi if test "x${PKG_CONFIG}" = "xno" then - AC_MSG_ERROR([pkg-config wasn't found! Please install from your vendor, or see http://pkg-config.freedesktop.org/wiki/]) + AC_MSG_ERROR([pkg-config was not found! Please install from your vendor, or see http://pkg-config.freedesktop.org/wiki/]) fi PKG_CHECK_MODULES([FUSE_MODULE], [fuse >= 2.6.0], , @@ -40,13 +40,34 @@ if test ! -z "${ffmpeg_found}" then dnl - dnl Check for libswscale + dnl Check for libavcodec dnl + libavcodec=no + AC_MSG_CHECKING([libavcodec]) FFMPEG_LIBS=`$PKG_CONFIG --libs libavcodec` FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavcodec` + PKG_CHECK_MODULES([LIBAVCODEC_MODULE], [libavcodec >= 0.7.1], libavcodec_found="yes", + AC_MSG_RESULT([FFmpeg was compiled with no support for libavcodec.])) + AVCODEC_LIBS=`$PKG_CONFIG --libs libavcodec` + dnl + dnl Check for libavutil + dnl + libavutil_found=no + AC_MSG_CHECKING([libavutil]) + FFMPEG_LIBS=`$PKG_CONFIG --libs libavutil` + FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavutil` + PKG_CHECK_MODULES([LIBAVUTIL_MODULE], [libavutil >= 0.7.1], libavutil_found="yes", + AC_MSG_RESULT([FFmpeg was compiled with no support for libavutil.])) + AVUTIL_LIBS=`$PKG_CONFIG --libs libavutil` + + dnl + dnl Check for libswscale + dnl libswscale_found=no AC_MSG_CHECKING([libswscale]) + FFMPEG_LIBS=`$PKG_CONFIG --libs libavcodec` + FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavcodec` PKG_CHECK_MODULES([LIBSWSCALE_MODULE], [libswscale >= 0.7.1], libswscale_found="yes", AC_MSG_RESULT([FFmpeg was compiled with no support for libswscale.])) SWSCALE_LIBS=`$PKG_CONFIG --libs libswscale` @@ -54,16 +75,16 @@ dnl dnl Check for libavformat dnl + libavformat_found=no + AC_MSG_CHECKING([libavformat]) FFMPEG_LIBS=`$PKG_CONFIG --libs libavformat` FFMPEG_CFLAGS=`$PKG_CONFIG --cflags libavformat` - - libavformat_found=no - AC_MSG_CHECKING([libavformat]) PKG_CHECK_MODULES([LIBAVFORMAT_MODULE], [libavformat >= 0.7.1], libavformat_found="yes", AC_MSG_RESULT([FFmpeg libavformat was not found.])) AVFORMAT_LIBS=`$PKG_CONFIG --libs libavformat` - if test "x$libswscale_found" != "xno" && test "x$libavformat_found" != "xno" + if test "x$libswscale_found" != "xno" && test "x$libavformat_found" != "xno" && + test "x$libavutil_found" != "xno" && test "x$libavcodec_found" != "xno" then CFLAGS="${CFLAGS} -DUSE_FFMPEG" fi @@ -121,7 +142,7 @@ dnl Update flags dnl CFLAGS="${CFLAGS} ${FUSE_CFLAGS} ${FFMPEG_CFLAGS} -ggdb -O3 -Wall" -LDFLAGS="${LDFLAGS} ${FUSE_LIBS} ${FFMPEG_LIBS} ${SWSCALE_LIBS} ${AVFORMAT_LIBS}" +LDFLAGS="${LDFLAGS} ${FUSE_LIBS} ${FFMPEG_LIBS} ${AVCODEC_LIBS} ${AVUTIL_LIBS} ${SWSCALE_LIBS} ${AVFORMAT_LIBS}" dnl dnl Output files Modified: src/main.c =================================================================== --- src/main.c 2014-06-25 22:08:39 UTC (rev 391) +++ src/main.c 2014-06-25 22:11:39 UTC (rev 392) @@ -116,7 +116,6 @@ struct demuxfs_data *priv = fuse_get_context()->private_data; #ifdef USE_FFMPEG - avcodec_init(); avcodec_register_all(); #endif priv->psi_tables = hashtable_new(DEMUXFS_MAX_PIDS); Modified: src/snapshot.c =================================================================== --- src/snapshot.c 2014-06-25 22:08:39 UTC (rev 391) +++ src/snapshot.c 2014-06-25 22:11:39 UTC (rev 392) @@ -53,8 +53,13 @@ xsize, ysize, PIX_FMT_RGB24, SWS_FAST_BILINEAR, NULL, NULL, NULL); - sws_scale(img_convert_ctx, ctx->picture->data, ctx->picture->linesize, 0, - ysize, rgb_picture->data, rgb_picture->linesize); + sws_scale( + img_convert_ctx, + (const uint8_t * const *) ctx->picture->data, + ctx->picture->linesize, + 0, ysize, + rgb_picture->data, + rgb_picture->linesize); /* Prepare the PPM header */ snprintf(header, sizeof(header), "P6\n%d %d\n%d\n", xsize, ysize, 255); @@ -93,8 +98,7 @@ if (ctx) { while (av_read_frame(ctx->format_context, &ctx->packet) >= 0) { - avcodec_decode_video(ctx->c, ctx->picture, &got_picture, - ctx->packet.data, ctx->packet.size); + avcodec_decode_video2(ctx->c, ctx->picture, &got_picture, &ctx->packet); if (got_picture && ++i > 10) { /* Store the decoded picture in the dentry memory */ ret = _snapshot_save_to_dentry(dentry); @@ -113,7 +117,7 @@ struct snapshot_context *ctx = priv_data->snapshot_ctx; if (ctx) { if (ctx->format_context) - av_close_input_file(ctx->format_context); + avformat_close_input(&ctx->format_context); if (ctx->c) { avcodec_close(ctx->c); ctx->c = NULL; @@ -163,20 +167,21 @@ if (! path_to_fifo) goto out_free; - ret = av_open_input_file(&ctx->format_context, path_to_fifo, ctx->input_format, 0, NULL); + ctx->format_context = NULL; + ret = avformat_open_input(&ctx->format_context, path_to_fifo, ctx->input_format, NULL); if (ret != 0) { dprintf("H.264 input stream not found"); goto out_free; } - ret = av_find_stream_info(ctx->format_context); + ret = avformat_find_stream_info(ctx->format_context, NULL); if (ret < 0) { dprintf("Could not find H.264 codec parameters"); goto out_free; } for (i=0; i < ctx->format_context->nb_streams; i++) - if (ctx->format_context->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO) { + if (ctx->format_context->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { video_stream = i; break; } @@ -192,7 +197,7 @@ goto out_free; } - ret = avcodec_open(ctx->c, ctx->codec); + ret = avcodec_open2(ctx->c, ctx->codec, NULL); if (ret < 0) { dprintf("Could not open H.264 codec"); goto out_free; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2014-06-25 22:08:41
|
Revision: 391 http://sourceforge.net/p/demuxfs/code/391 Author: lucasvr Date: 2014-06-25 22:08:39 +0000 (Wed, 25 Jun 2014) Log Message: ----------- Check retval before processing contents of the buffer. Modified Paths: -------------- src/ts.c Modified: src/ts.c =================================================================== --- src/ts.c 2010-12-21 18:05:08 UTC (rev 390) +++ src/ts.c 2014-06-25 22:08:39 UTC (rev 391) @@ -286,7 +286,7 @@ if (buffer) { int ret = buffer_append(buffer, start, end - start + 1); - if (buffer_contains_full_psi_section(buffer)) { + if (ret >= 0 && buffer_contains_full_psi_section(buffer)) { table_id = buffer->data[0]; if (! crc32_check(buffer->data, buffer->current_size) && priv->options.verbose_mask & CRC_ERROR) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rpn...@us...> - 2010-12-21 18:05:14
|
Revision: 390 http://demuxfs.svn.sourceforge.net/demuxfs/?rev=390&view=rev Author: rpnwoody Date: 2010-12-21 18:05:08 +0000 (Tue, 21 Dec 2010) Log Message: ----------- Another fix to a0 example private descriptor. Modified Paths: -------------- src/tables/descriptors/parser_0xa0.c Modified: src/tables/descriptors/parser_0xa0.c =================================================================== --- src/tables/descriptors/parser_0xa0.c 2010-12-21 14:15:53 UTC (rev 389) +++ src/tables/descriptors/parser_0xa0.c 2010-12-21 18:05:08 UTC (rev 390) @@ -45,20 +45,23 @@ struct formatted_descriptor f; int i; - if (! descriptor_is_parseable(parent, payload[0], 2, len)) + if (! descriptor_is_parseable(parent, payload[0], 3, len)) return -ENODATA; dentry = CREATE_DIRECTORY(parent, "FS_Descriptor"); f.reference_level = payload[2]; - for (i=0; i<len && i<255; i++) - f.free_text[i] = payload[i+3]; - f.free_text[i] = '\0'; - CREATE_FILE_NUMBER(dentry, &f, reference_level); - CREATE_FILE_STRING(dentry, &f, free_text, XATTR_FORMAT_STRING); - return 0; + if (len > 1) { + for (i=0; i<len-1 && i<255; i++) + f.free_text[i] = payload[i+3]; + f.free_text[i] = '\0'; + + CREATE_FILE_STRING(dentry, &f, free_text, XATTR_FORMAT_STRING); + } + + return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rpn...@us...> - 2010-12-21 14:16:00
|
Revision: 389 http://demuxfs.svn.sourceforge.net/demuxfs/?rev=389&view=rev Author: rpnwoody Date: 2010-12-21 14:15:53 +0000 (Tue, 21 Dec 2010) Log Message: ----------- Updating descriptor 0x7c to latest standard and fixing reference private descriptor 0xa0. Modified Paths: -------------- src/tables/descriptors/parser_0x7c.c src/tables/descriptors/parser_0xa0.c Modified: src/tables/descriptors/parser_0x7c.c =================================================================== --- src/tables/descriptors/parser_0x7c.c 2010-12-15 21:15:19 UTC (rev 388) +++ src/tables/descriptors/parser_0x7c.c 2010-12-21 14:15:53 UTC (rev 389) @@ -62,45 +62,196 @@ offset = 4; switch (d._profile_and_level) { - case 0x00 ... 0x27: + case 0x00 ... 0x0e: asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); break; + case 0x0f: + asprintf(&d.profile_and_level, "No audio profile and level defined for the " \ + "associated MPEG-4 audio stream [%#x]", d._profile_and_level); + break; + case 0x10: + asprintf(&d.profile_and_level, "Main profile, level 1 [%#x]", d._profile_and_level); + break; + case 0x11: + asprintf(&d.profile_and_level, "Main profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x12: + asprintf(&d.profile_and_level, "Main profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x13: + asprintf(&d.profile_and_level, "Main profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x14 ... 0x17: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); + break; + case 0x18: + asprintf(&d.profile_and_level, "Scalable profile, level 1 [%#x]", d._profile_and_level); + break; + case 0x19: + asprintf(&d.profile_and_level, "Scalable profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x1a: + asprintf(&d.profile_and_level, "Scalable profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x1b: + asprintf(&d.profile_and_level, "Scalable profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x1c ... 0x1f: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); + break; + case 0x20: + asprintf(&d.profile_and_level, "Speech profile, level 1 [%#x]", d._profile_and_level); + break; + case 0x21: + asprintf(&d.profile_and_level, "Speech profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x22 ... 0x27: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); + break; case 0x28: - asprintf(&d.profile_and_level, "AAC Profile L1 [%#x]", d._profile_and_level); + asprintf(&d.profile_and_level, "Synthesis profile, level 1 [%#x]", d._profile_and_level); break; case 0x29: - asprintf(&d.profile_and_level, "AAC Profile L2 [%#x]", d._profile_and_level); + asprintf(&d.profile_and_level, "Synthesis profile, level 2 [%#x]", d._profile_and_level); break; case 0x2a: - asprintf(&d.profile_and_level, "AAC Profile L4 [%#x]", d._profile_and_level); + asprintf(&d.profile_and_level, "Synthesis profile, level 3 [%#x]", d._profile_and_level); break; - case 0x2b: - asprintf(&d.profile_and_level, "AAC Profile L5 [%#x]", d._profile_and_level); + case 0x2b ... 0x2f: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); break; - case 0x2c: - asprintf(&d.profile_and_level, "High Efficiency AAC Profile L2 [%#x]", d._profile_and_level); + case 0x30: + asprintf(&d.profile_and_level, "High quality audio profile, level 1 [%#x]", d._profile_and_level); break; - case 0x2d: - asprintf(&d.profile_and_level, "High Efficiency AAC Profile L3 [%#x]", d._profile_and_level); + case 0x31: + asprintf(&d.profile_and_level, "High quality audio profile, level 2 [%#x]", d._profile_and_level); break; - case 0x2e: - asprintf(&d.profile_and_level, "High Efficiency AAC Profile L4 [%#x]", d._profile_and_level); + case 0x32: + asprintf(&d.profile_and_level, "High quality audio profile, level 3 [%#x]", d._profile_and_level); break; - case 0x2f: - asprintf(&d.profile_and_level, "High Efficiency AAC Profile L5 [%#x]", d._profile_and_level); + case 0x33: + asprintf(&d.profile_and_level, "High quality audio profile, level 4 [%#x]", d._profile_and_level); break; - case 0x30 ... 0x7f: + case 0x34: + asprintf(&d.profile_and_level, "High quality audio profile, level 5 [%#x]", d._profile_and_level); + break; + case 0x35: + asprintf(&d.profile_and_level, "High quality audio profile, level 6 [%#x]", d._profile_and_level); + break; + case 0x36: + asprintf(&d.profile_and_level, "High quality audio profile, level 7 [%#x]", d._profile_and_level); + break; + case 0x37: + asprintf(&d.profile_and_level, "High quality audio profile, level 8 [%#x]", d._profile_and_level); + break; + case 0x38: + asprintf(&d.profile_and_level, "Low delay audio profile, level 1 [%#x]", d._profile_and_level); + break; + case 0x39: + asprintf(&d.profile_and_level, "Low delay audio profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x3a: + asprintf(&d.profile_and_level, "Low delay audio profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x3b: + asprintf(&d.profile_and_level, "Low delay audio profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x3c: + asprintf(&d.profile_and_level, "Low delay audio profile, level 5 [%#x]", d._profile_and_level); + break; + case 0x3d: + asprintf(&d.profile_and_level, "Low delay audio profile, level 6 [%#x]", d._profile_and_level); + break; + case 0x3e: + asprintf(&d.profile_and_level, "Low delay audio profile, level 7 [%#x]", d._profile_and_level); + break; + case 0x3f: + asprintf(&d.profile_and_level, "Low delay audio profile, level 8 [%#x]", d._profile_and_level); + break; + case 0x40: + asprintf(&d.profile_and_level, "Natural audio profile, level 1 [%#x]", d._profile_and_level); + break; + case 0x41: + asprintf(&d.profile_and_level, "Natural audio profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x42: + asprintf(&d.profile_and_level, "Natural audio profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x43: + asprintf(&d.profile_and_level, "Natural audio profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x44 ... 0x47: asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); break; - case 0x80 ... 0xfd: - asprintf(&d.profile_and_level, "Private use [%#x]", d._profile_and_level); + case 0x48: + asprintf(&d.profile_and_level, "Mobile audio internetworking profile, level 1 [%#x]", d._profile_and_level); break; - case 0xfe: - asprintf(&d.profile_and_level, "Audio profile not specified [%#x]", d._profile_and_level); + case 0x49: + asprintf(&d.profile_and_level, "Mobile audio internetworking profile, level 2 [%#x]", d._profile_and_level); break; + case 0x4a: + asprintf(&d.profile_and_level, "Mobile audio internetworking profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x4b: + asprintf(&d.profile_and_level, "Mobile audio internetworking profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x4c: + asprintf(&d.profile_and_level, "Mobile audio internetworking profile, level 5 [%#x]", d._profile_and_level); + break; + case 0x4d: + asprintf(&d.profile_and_level, "Mobile audio internetworking profile, level 6 [%#x]", d._profile_and_level); + break; + case 0x4e ... 0x4f: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); + break; + case 0x50: + asprintf(&d.profile_and_level, "AAC profile, level 1 [%#x]", d._profile_and_level); + break; + case 0x51: + asprintf(&d.profile_and_level, "AAC profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x52: + asprintf(&d.profile_and_level, "AAC profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x53: + asprintf(&d.profile_and_level, "AAC profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x54 ... 0x57: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); + break; + case 0x58: + asprintf(&d.profile_and_level, "High efficiency AAC profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x59: + asprintf(&d.profile_and_level, "High efficiency AAC profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x5a: + asprintf(&d.profile_and_level, "High efficiency AAC profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x5b: + asprintf(&d.profile_and_level, "High efficiency AAC profile, level 5 [%#x]", d._profile_and_level); + break; + case 0x5c ... 0x5f: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); + break; + case 0x60: + asprintf(&d.profile_and_level, "High efficiency AAC v2 profile, level 2 [%#x]", d._profile_and_level); + break; + case 0x61: + asprintf(&d.profile_and_level, "High efficiency AAC v2 profile, level 3 [%#x]", d._profile_and_level); + break; + case 0x62: + asprintf(&d.profile_and_level, "High efficiency AAC v2 profile, level 4 [%#x]", d._profile_and_level); + break; + case 0x63: + asprintf(&d.profile_and_level, "High efficiency AAC v2 profile, level 5 [%#x]", d._profile_and_level); + break; + case 0x64 ... 0xfe: + asprintf(&d.profile_and_level, "Reserved [%#x]", d._profile_and_level); + break; case 0xff: default: - asprintf(&d.profile_and_level, "Audio description is not available [%#x]", d._profile_and_level); + asprintf(&d.profile_and_level, "Audio profile and level not specified [%#x]", d._profile_and_level); } if (d.profile_and_level) { CREATE_FILE_STRING(dentry, &d, profile_and_level, XATTR_FORMAT_STRING_AND_NUMBER); Modified: src/tables/descriptors/parser_0xa0.c =================================================================== --- src/tables/descriptors/parser_0xa0.c 2010-12-15 21:15:19 UTC (rev 388) +++ src/tables/descriptors/parser_0xa0.c 2010-12-21 14:15:53 UTC (rev 389) @@ -33,7 +33,7 @@ #include "descriptors.h" struct formatted_descriptor { - //uint8_t reference_level; + uint8_t reference_level; char free_text[256]; }; @@ -48,13 +48,15 @@ if (! descriptor_is_parseable(parent, payload[0], 2, len)) return -ENODATA; - dentry = CREATE_DIRECTORY(parent, "FreeSurround_Descriptor"); + dentry = CREATE_DIRECTORY(parent, "FS_Descriptor"); - for (i=0; i<len; i++) - f.free_text[i] = payload[i+2]; - //f.free_text[i] = '\0'; + f.reference_level = payload[2]; - //CREATE_FILE_NUMBER(dentry, &f, reference_level); + for (i=0; i<len && i<255; i++) + f.free_text[i] = payload[i+3]; + f.free_text[i] = '\0'; + + CREATE_FILE_NUMBER(dentry, &f, reference_level); CREATE_FILE_STRING(dentry, &f, free_text, XATTR_FORMAT_STRING); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-12-15 21:15:25
|
Revision: 388 http://demuxfs.svn.sourceforge.net/demuxfs/?rev=388&view=rev Author: lucasvr Date: 2010-12-15 21:15:19 +0000 (Wed, 15 Dec 2010) Log Message: ----------- Don't print "read error" after no more data is available when reading from a file source. Modified Paths: -------------- src/backends/filesrc.c src/main.c Modified: src/backends/filesrc.c =================================================================== --- src/backends/filesrc.c 2010-12-15 17:53:54 UTC (rev 387) +++ src/backends/filesrc.c 2010-12-15 21:15:19 UTC (rev 388) @@ -161,6 +161,8 @@ /** * filesrc_read_parser: backend's read() method. + * @return 0 on success, -1 on error and -ENODATA if there's no more + * data to be read. */ int filesrc_read_packet(struct demuxfs_data *priv) { @@ -173,7 +175,7 @@ rewind(p->fp); return 0; } - return -1; + return -ENODATA; } else if (n < 1) { p->packet_valid = false; perror("fread"); Modified: src/main.c =================================================================== --- src/main.c 2010-12-15 17:53:54 UTC (rev 387) +++ src/main.c 2010-12-15 21:15:19 UTC (rev 388) @@ -58,7 +58,8 @@ while (priv->backend->keep_alive(priv) && !main_thread_stopped) { ret = priv->backend->read(priv); if (ret < 0) { - dprintf("read error"); + if (ret != -ENODATA) + dprintf("read error"); break; } ret = priv->backend->process(&header, &payload, priv); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-12-15 17:54:00
|
Revision: 387 http://demuxfs.svn.sourceforge.net/demuxfs/?rev=387&view=rev Author: lucasvr Date: 2010-12-15 17:53:54 +0000 (Wed, 15 Dec 2010) Log Message: ----------- Allow demuxfs to be compiled from a separate build tree and add a parser for a non-standard descriptor, 0xa0. Contribution from Rogerio P. Nunes. Modified Paths: -------------- src/Makefile.am src/backends/Makefile.am src/dsm-cc/Makefile.am src/dsm-cc/descriptors/Makefile.am src/tables/Makefile.am src/tables/descriptors/Makefile.am src/tables/descriptors/descriptors.c src/tables/descriptors/descriptors.h Added Paths: ----------- src/tables/descriptors/parser_0xa0.c Modified: src/Makefile.am =================================================================== --- src/Makefile.am 2010-11-18 21:23:05 UTC (rev 386) +++ src/Makefile.am 2010-12-15 17:53:54 UTC (rev 387) @@ -3,11 +3,11 @@ # DemuxFS Library noinst_LTLIBRARIES = libdemuxfs.la libdemuxfs_la_SOURCES = demuxfs.c ts.c snapshot.c fsutils.c hash.c xattr.c buffer.c crc32.c -if USE_POSIX_FIFOS -libdemuxfs_la_SOURCES += fifo_posix.c -else +#if USE_POSIX_FIFOS +#libdemuxfs_la_SOURCES += fifo_posix.c +#else libdemuxfs_la_SOURCES += fifo_generic.c -endif +#endif libdemuxfs_la_DEPENDENCIES = tables/libtables.la libdemuxfs_la_LIBADD = tables/libtables.la @@ -16,6 +16,6 @@ demuxfs_SOURCES = main.c backend.c demuxfs_DEPENDENCIES = libdemuxfs.la demuxfs_LDADD = libdemuxfs.la -demuxfs_CPPFLAGS = -I backends -I tables -DLIBDIR="\"@libdir@\"" +demuxfs_CPPFLAGS = -I${top_srcdir}/src/backends -I${top_srcdir}/src/tables -DLIBDIR="\"@libdir@\"" SUBDIRS = dsm-cc tables backends Modified: src/backends/Makefile.am =================================================================== --- src/backends/Makefile.am 2010-11-18 21:23:05 UTC (rev 386) +++ src/backends/Makefile.am 2010-12-15 17:53:54 UTC (rev 387) @@ -5,11 +5,11 @@ if USE_FILESRC lib_LTLIBRARIES += libfilesrc.la libfilesrc_la_SOURCES = filesrc.c filesrc.h -libfilesrc_la_CPPFLAGS = -I. -I.. +libfilesrc_la_CPPFLAGS = -I${top_srcdir}/src/backends -I${top_srcdir}/src endif if USE_LINUXDVB lib_LTLIBRARIES += liblinuxdvb.la liblinuxdvb_la_SOURCES = linuxdvb.c linuxdvb.h -liblinuxdvb_la_CPPFLAGS = -I. -I.. +liblinuxdvb_la_CPPFLAGS = -I${top_srcdir}/src/backends -I${top_srcdir}/src endif Modified: src/dsm-cc/Makefile.am =================================================================== --- src/dsm-cc/Makefile.am 2010-11-18 21:23:05 UTC (rev 386) +++ src/dsm-cc/Makefile.am 2010-12-15 17:53:54 UTC (rev 387) @@ -5,6 +5,6 @@ libdsmcc_la_DEPENDENCIES = descriptors/libdsmcc_descriptors.la libdsmcc_la_LIBADD = descriptors/libdsmcc_descriptors.la -AM_CPPFLAGS = -I. -I.. -I../backends -Idescriptors +AM_CPPFLAGS = -I${top_srcdir}/src/dsm-cc -I${top_srcdir}/src -I${top_srcdir}/src/backends -I${top_srcdir}/src/dsm-cc/descriptors SUBDIRS = descriptors Modified: src/dsm-cc/descriptors/Makefile.am =================================================================== --- src/dsm-cc/descriptors/Makefile.am 2010-11-18 21:23:05 UTC (rev 386) +++ src/dsm-cc/descriptors/Makefile.am 2010-12-15 17:53:54 UTC (rev 387) @@ -14,4 +14,4 @@ libdsmcc_descriptors_la_SOURCES = descriptors.c broadcaster.c $(parsers) libdsmcc_descriptors_la_SOURCES += descriptors.h -AM_CPPFLAGS = -I. -I../.. -I../../backends +AM_CPPFLAGS = -I${top_srcdir}/src/dsm-cc/descriptors -I${top_srcdir}/src -I${top_srcidr}/src/backends Modified: src/tables/Makefile.am =================================================================== --- src/tables/Makefile.am 2010-11-18 21:23:05 UTC (rev 386) +++ src/tables/Makefile.am 2010-12-15 17:53:54 UTC (rev 387) @@ -5,6 +5,6 @@ libtables_la_DEPENDENCIES = descriptors/libdescriptors.la ../dsm-cc/libdsmcc.la libtables_la_LIBADD = descriptors/libdescriptors.la ../dsm-cc/libdsmcc.la -AM_CPPFLAGS = -I. -I.. -I../backends -I../dsm-cc -Idescriptors +AM_CPPFLAGS = -I${top_srcdir}/src/tables -I${top_srcdir}/src -I${top_srcdir}/src/backends -I${top_srcdir}/src/dsm-cc -I${top_srcdir}/src/tables/descriptors SUBDIRS = descriptors Modified: src/tables/descriptors/Makefile.am =================================================================== --- src/tables/descriptors/Makefile.am 2010-11-18 21:23:05 UTC (rev 386) +++ src/tables/descriptors/Makefile.am 2010-12-15 17:53:54 UTC (rev 387) @@ -54,6 +54,7 @@ parser_0x58.c \ parser_0x63.c \ parser_0x7c.c \ + parser_0xa0.c \ parser_0xc0.c \ parser_0xc1.c \ parser_0xc2.c \ @@ -98,4 +99,4 @@ libdescriptors_la_SOURCES = descriptors.c services.c component_tag.c stream_type.c $(parsers) libdescriptors_la_SOURCES += descriptors.h services.h component_tag.h stream_type.h -AM_CPPFLAGS = -I. -I../.. -I../../backends +AM_CPPFLAGS = -I${top_srcdir}/src/tables/descriptors -I${top_srcdir}/src -I${top_srcdir}/src/backends Modified: src/tables/descriptors/descriptors.c =================================================================== --- src/tables/descriptors/descriptors.c 2010-11-18 21:23:05 UTC (rev 386) +++ src/tables/descriptors/descriptors.c 2010-12-15 17:53:54 UTC (rev 387) @@ -171,6 +171,7 @@ ADD_DESCRIPTOR("Partial_Transport_Stream_Descriptor", 0x63, priv); ADD_DESCRIPTOR("AAC_Audio_Descriptor", 0x7c, priv); /* 0x80 - 0xBF - Reserved for identification of companies */ + ADD_DESCRIPTOR("FS_Metadata_Descriptor", 0xa0, priv); ADD_DESCRIPTOR("Hierarchical_Transmission_Descriptor", 0xc0, priv); ADD_DESCRIPTOR("Digital_Copy_Control_Descriptor", 0xc1, priv); ADD_DESCRIPTOR("Network_Identifier_Descriptor", 0xc2, priv); Modified: src/tables/descriptors/descriptors.h =================================================================== --- src/tables/descriptors/descriptors.h 2010-11-18 21:23:05 UTC (rev 386) +++ src/tables/descriptors/descriptors.h 2010-12-15 17:53:54 UTC (rev 387) @@ -72,6 +72,7 @@ int descriptor_0x58_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv); int descriptor_0x63_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv); int descriptor_0x7c_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv); +int descriptor_0xa0_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv); int descriptor_0xc0_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv); int descriptor_0xc1_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv); int descriptor_0xc2_parser(const char *payload, int len, struct dentry *parent, struct demuxfs_data *priv); Added: src/tables/descriptors/parser_0xa0.c =================================================================== --- src/tables/descriptors/parser_0xa0.c (rev 0) +++ src/tables/descriptors/parser_0xa0.c 2010-12-15 17:53:54 UTC (rev 387) @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, Rogerio P. Nunes <ro...@or...> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of GoboLinux nor the names of its contributors may + * be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "demuxfs.h" +#include "fsutils.h" +#include "xattr.h" +#include "ts.h" +#include "descriptors.h" + +struct formatted_descriptor { + //uint8_t reference_level; + char free_text[256]; +}; + +/* FS_METADATA_DESCRIPTOR parser */ +int descriptor_0xa0_parser(const char *payload, int len, struct dentry *parent, + struct demuxfs_data *priv) +{ + struct dentry *dentry; + struct formatted_descriptor f; + int i; + + if (! descriptor_is_parseable(parent, payload[0], 2, len)) + return -ENODATA; + + dentry = CREATE_DIRECTORY(parent, "FreeSurround_Descriptor"); + + for (i=0; i<len; i++) + f.free_text[i] = payload[i+2]; + //f.free_text[i] = '\0'; + + //CREATE_FILE_NUMBER(dentry, &f, reference_level); + CREATE_FILE_STRING(dentry, &f, free_text, XATTR_FORMAT_STRING); + + return 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |