]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Remove "mux"ing code which has been replaced with the "streaming" components
authorAndreas Öman <andreas@lonelycoder.com>
Sat, 20 Sep 2008 06:10:10 +0000 (06:10 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sat, 20 Sep 2008 06:10:10 +0000 (06:10 +0000)
mux.c [deleted file]
mux.h [deleted file]
parsers.c
transports.c
tvhead.h

diff --git a/mux.c b/mux.c
deleted file mode 100644 (file)
index bda4e31..0000000
--- a/mux.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *  tvheadend, Muxing
- *  Copyright (C) 2007 Andreas Öman
- *
- *  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 3 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <pthread.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "tvhead.h"
-#include "transports.h"
-#include "subscriptions.h"
-#include "psi.h"
-#include "buffer.h"
-#include "mux.h"
-
-/**
- * pause playback
- */
-void
-muxer_pause(th_muxer_t *tm)
-{
-}
-
-
-
-
-/*
- * playback start
- */
-void
-muxer_play(th_muxer_t *tm, int64_t toffset)
-{
-  th_transport_t *t = tm->tm_transport;
-
-  transport_link_muxer(t, tm);
-
-  if(toffset == AV_NOPTS_VALUE) {
-    /* continue from last playback */
-    tm->tm_offset = 0;
-  } else {
-    tm->tm_offset = toffset;
-  }
-  tm->tm_status = TM_PLAY;
-}
-
-/**
- *
- */
-static void
-mux_new_packet_for_stream(th_muxer_t *tm, th_muxstream_t *tms, th_pkt_t *pkt)
-{
-  if(tm->tm_offset == 0) {
-    /* Direct playback, pass it on at once */
-    tm->tm_output(tm->tm_opaque, tms, pkt);
-    return;
-  }
-}
-
-
-
-/**
- *
- */
-static void
-mux_new_packet(th_muxer_t *tm, th_stream_t *st, th_pkt_t *pkt)
-{
-  th_muxstream_t *tms;
-
-  pkt_store(st, pkt);  /* need to keep packet around */
-
-  switch(tm->tm_status) {
-  case TM_IDLE:
-    break;
-    
-  case TM_WAITING_FOR_LOCK:
-    break;
-
-  case TM_PLAY:
-    LIST_FOREACH(tms, &tm->tm_streams, tms_muxer_link0) {
-      if(tms->tms_stream == st) {
-       mux_new_packet_for_stream(tm, tms, pkt);
-       break;
-      }
-    }
-    break;
-    
-  case TM_PAUSE:
-    break;
-  }
-}
-
-
-
-
-
-/*
- * TS Muxer
- */
-th_muxer_t *
-muxer_create(th_transport_t *t, th_mux_output_t *cb, void *opaque)
-{
-  th_stream_t *st;
-  th_muxer_t *tm;
-  th_muxstream_t *tms;
-
-  tm = calloc(1, sizeof(th_muxer_t));
-  tm->tm_transport = t;
-
-  tm->tm_output = cb;
-  tm->tm_opaque = opaque;
-  tm->tm_new_pkt = mux_new_packet;
-
-
-  LIST_FOREACH(st, &t->tht_streams, st_link) {
-
-    switch(st->st_type) {
-    case HTSTV_MPEG2VIDEO:
-    case HTSTV_MPEG2AUDIO:
-    case HTSTV_AC3:
-    case HTSTV_H264:
-      break;
-
-    default:
-      continue;
-    }
-
-    tms = calloc(1, sizeof(th_muxstream_t));
-    tms->tms_muxer = tm;
-    tms->tms_stream = st;
-
-    LIST_INSERT_HEAD(&tm->tm_streams, tms, tms_muxer_link0);
-  }
-  return tm;
-}
-
-
-/*
- *
- */
-static void
-tms_destroy(th_muxstream_t *tms)
-{
-  LIST_REMOVE(tms, tms_muxer_link0);
-
-  //  dtimer_disarm(&tms->tms_timer);
-  free(tms);
-}
-
-
-/**
- *
- */
-void
-muxer_destroy(th_muxer_t *tm)
-{
-  th_muxstream_t *tms;
-
-  transport_unlink_muxer(tm);
-
-  while((tms = LIST_FIRST(&tm->tm_streams)) != NULL)
-    tms_destroy(tms);
-
-  free(tm);
-}
-
diff --git a/mux.h b/mux.h
deleted file mode 100644 (file)
index 77018c5..0000000
--- a/mux.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  tvheadend, Stream muxer
- *  Copyright (C) 2007 Andreas Öman
- *
- *  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 3 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MUX_H
-#define MUX_H
-
-th_muxer_t *muxer_create(th_transport_t *t, th_mux_output_t *cb, void *opaque);
-
-void muxer_destroy(th_muxer_t *tm);
-
-void muxer_play(th_muxer_t *tm, int64_t toffset);
-
-void muxer_pause(th_muxer_t *tm);
-
-#endif /* MUX_H */
index 22ee392cd6d606344bfe432e43db153205abfb4c..a99cd9d6b30a50536bd6d7123a179ba7cdd7f051 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -106,7 +106,7 @@ parse_raw_mpeg(th_transport_t *t, th_stream_t *st, uint8_t *data,
 {
   th_subscription_t *s;
 
-  if(LIST_FIRST(&t->tht_muxers) == NULL) {
+  if(LIST_FIRST(&t->tht_streaming_pad.sp_targets) == NULL) {
     /* No muxers. However, subscriptions may force demultiplex 
        for other reasons (serviceprobe does this) */
     LIST_FOREACH(s, &t->tht_subscriptions, ths_transport_link)
index 71f34ccebdd87a917d580544f4bb747b7bf839f6..b5dd4f41d0fc30025b8cd06fedc81b5f69df7b95 100644 (file)
@@ -81,7 +81,7 @@ transport_stop(th_transport_t *t)
 
   t->tht_tt_commercial_advice = COMMERCIAL_UNKNOWN;
  
-  assert(LIST_FIRST(&t->tht_muxers) == NULL);
+  assert(LIST_FIRST(&t->tht_streaming_pad.sp_targets) == NULL);
   assert(LIST_FIRST(&t->tht_subscriptions) == NULL);
 
   /**
index e3ddd603a4259d2aa9316c347257c16903d246f1..d1a06ed4ac5da059e37d53dacad08aa64ccfb2d6 100644 (file)
--- a/tvhead.h
+++ b/tvhead.h
@@ -678,14 +678,6 @@ typedef struct th_transport {
   int tht_scrambled;
   int tht_caid;
 
-  /**
-   * List of muxers
-   *
-   * The parsing code will invoke each of these whene complete
-   * packets have been assembled.
-   */
-  struct th_muxer_list tht_muxers;
-
   /**
    * Used by parsing code to normalize timestamp to zero
    */
@@ -813,63 +805,6 @@ typedef struct th_muxstream {
 } th_muxstream_t;
 
 
-/*
- *
- */
-
-
-typedef void (th_mux_newpkt_t)(struct th_muxer *tm, th_stream_t *st,
-                              th_pkt_t *pkt);
-
-typedef struct th_muxer {
-
-  th_mux_newpkt_t *tm_new_pkt;
-
-  LIST_ENTRY(th_muxer) tm_transport_link;
-  th_transport_t *tm_transport;
-
-  int64_t tm_offset;
-
-  struct th_muxstream_list tm_streams;
-
-  th_mux_output_t *tm_output;
-  void *tm_opaque;
-  
-
-  enum {
-    TM_IDLE,
-    TM_WAITING_FOR_LOCK,
-    TM_PLAY,
-    TM_PAUSE,
-  } tm_status;
-
-} th_muxer_t;
-
-
-/**
- * Output muxer for usage via ffmpeg (avformat)
- */
-typedef struct th_ffmuxer {
-  th_muxer_t tffm_muxer;
-  
-  enum {
-    TFFM_STOP,
-    TFFM_WAIT_SUBSCRIPTION,
-    TFFM_WAIT_FOR_START,
-    TFFM_WAIT_AUDIO_LOCK,
-    TFFM_WAIT_VIDEO_LOCK,
-    TFFM_RUNNING,
-    TFFM_COMMERCIAL,
-
-  } tffm_state;
-
-  int tffm_header_written;
-
-  char *tffm_printname;
-
-  struct AVFormatContext *tffm_avfctx;
-} th_ffmuxer_t;
-
 #endif