aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mov.c1
-rw-r--r--libmpdemux/demux_nuv.c461
-rw-r--r--libmpdemux/demuxer.c2
-rw-r--r--libmpdemux/demuxer.h1
-rw-r--r--libmpdemux/nuppelvideo.h179
5 files changed, 0 insertions, 644 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index fb271e1e49..ecc23f2cc5 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -2193,7 +2193,6 @@ if(trak->pos==0 && trak->stream_header_len>0){
if (samplenr < 0)
vo_sub = NULL;
else if (samplenr != priv->current_sub) {
- av_unused sh_sub_t *sh = demuxer->sub->sh;
off_t pos = trak->samples[samplenr].pos;
int len = trak->samples[samplenr].size;
double subpts = (double)trak->samples[samplenr].pts / (double)trak->timescale;
diff --git a/libmpdemux/demux_nuv.c b/libmpdemux/demux_nuv.c
deleted file mode 100644
index 2ca1d2b452..0000000000
--- a/libmpdemux/demux_nuv.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * NuppelVideo 0.05 file parser
- * for MPlayer
- * by Panagiotis Issaris <takis@lumumba.luc.ac.be>
- *
- * Reworked by alex
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "help_mp.h"
-#include "stream/stream.h"
-#include "demuxer.h"
-#include "stheader.h"
-#include "nuppelvideo.h"
-
-
-struct nuv_signature
-{
- char finfo[12]; /* "NuppelVideo" + \0 */
- char version[5]; /* "0.05" + \0 */
-};
-
-typedef struct nuv_position_t nuv_position_t;
-
-struct nuv_position_t
-{
- off_t offset;
- float time;
- int frame;
- nuv_position_t* next;
-};
-
-typedef struct nuv_info_t
-{
- int current_audio_frame;
- int current_video_frame;
- nuv_position_t *index_list;
- nuv_position_t *current_position;
-} nuv_priv_t;
-
-/**
- * \brief find best matching bitrate (in kbps) out of a table
- * \param bitrate bitrate to find best match for
- * \return best match from table
- */
-static int nearestBitrate(int bitrate) {
- const int rates[17] = {8000, 16000, 24000, 32000, 40000, 48000, 56000,
- 64000, 80000, 96000, 112000, 128000, 160000,
- 192000, 224000, 256000, 320000};
- int i;
- for (i = 0; i < 16; i++) {
- if ((rates[i] + rates[i + 1]) / 2 > bitrate)
- break;
- }
- return rates[i];
-}
-
-/**
- * Seek to a position relative to the current position, indicated in time.
- */
-static void demux_seek_nuv ( demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags )
-{
-#define MAX_TIME 1000000
- nuv_priv_t* priv = demuxer->priv;
- struct rtframeheader rtjpeg_frameheader;
- off_t orig_pos;
- off_t curr_pos;
- float current_time = 0;
- float start_time = MAX_TIME;
- float target_time = start_time + rel_seek_secs * 1000; /* target_time, start_time are ms, rel_seek_secs s */
-
- orig_pos = stream_tell ( demuxer->stream );
-
- if ( rel_seek_secs > 0 )
- {
- /* Seeking forward */
-
-
- while(current_time < target_time )
- {
- if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
- return; /* EOF */
- le2me_rtframeheader(&rtjpeg_frameheader);
-
- if ( rtjpeg_frameheader.frametype == 'V' )
- {
- priv->current_position->next = (nuv_position_t*) malloc ( sizeof ( nuv_position_t ) );
- priv->current_position = priv->current_position->next;
- priv->current_position->frame = priv->current_video_frame++;
- priv->current_position->time = rtjpeg_frameheader.timecode;
- priv->current_position->offset = orig_pos;
- priv->current_position->next = NULL;
-
- if ( start_time == MAX_TIME )
- {
- start_time = rtjpeg_frameheader.timecode;
- /* Recalculate target time with real start time */
- target_time = start_time + rel_seek_secs*1000;
- }
-
- current_time = rtjpeg_frameheader.timecode;
-
- curr_pos = stream_tell ( demuxer->stream );
- stream_seek ( demuxer->stream, curr_pos + rtjpeg_frameheader.packetlength );
-
- /* Adjust current sequence pointer */
- }
- else if ( rtjpeg_frameheader.frametype == 'A' )
- {
- if ( start_time == MAX_TIME )
- {
- start_time = rtjpeg_frameheader.timecode;
- /* Recalculate target time with real start time */
- target_time = start_time + rel_seek_secs * 1000;
- }
- current_time = rtjpeg_frameheader.timecode;
-
-
- curr_pos = stream_tell ( demuxer->stream );
- stream_seek ( demuxer->stream, curr_pos + rtjpeg_frameheader.packetlength );
- }
- }
- }
- else
- {
- /* Seeking backward */
- nuv_position_t* p;
- start_time = priv->current_position->time;
-
- /* Recalculate target time with real start time */
- target_time = start_time + rel_seek_secs * 1000;
-
-
- if(target_time < 0)
- target_time = 0;
-
- // Search the target time in the index list, get the offset
- // and go to that offset.
- p = priv->index_list;
- while ( ( p->next != NULL ) && ( p->time < target_time ) )
- {
- p = p->next;
- }
- stream_seek ( demuxer->stream, p->offset );
- priv->current_video_frame = p->frame;
- }
-}
-
-
-static int demux_nuv_fill_buffer ( demuxer_t *demuxer, demux_stream_t *ds )
-{
- struct rtframeheader rtjpeg_frameheader;
- off_t orig_pos;
- nuv_priv_t* priv = demuxer->priv;
- int want_audio = (demuxer->audio)&&(demuxer->audio->id!=-2);
-
- demuxer->filepos = orig_pos = stream_tell ( demuxer->stream );
- if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
- return 0; /* EOF */
- le2me_rtframeheader(&rtjpeg_frameheader);
-
-#if 0
- printf("NUV frame: frametype: %c, comptype: %c, packetlength: %d\n",
- rtjpeg_frameheader.frametype, rtjpeg_frameheader.comptype,
- rtjpeg_frameheader.packetlength);
-#endif
-
- /* Skip Seekpoint, Extended header and Sync for now */
- if ((rtjpeg_frameheader.frametype == 'R') ||
- (rtjpeg_frameheader.frametype == 'X') ||
- (rtjpeg_frameheader.frametype == 'S'))
- return 1;
-
- /* Skip seektable and text (these have a payload) */
- if ((rtjpeg_frameheader.frametype == 'Q') ||
- (rtjpeg_frameheader.frametype == 'T')) {
- stream_skip(demuxer->stream, rtjpeg_frameheader.packetlength);
- return 1;
- }
-
- if (((rtjpeg_frameheader.frametype == 'D') &&
- (rtjpeg_frameheader.comptype == 'R')) ||
- (rtjpeg_frameheader.frametype == 'V'))
- {
- if ( rtjpeg_frameheader.frametype == 'V' )
- {
- priv->current_video_frame++;
- priv->current_position->next = (nuv_position_t*) malloc(sizeof(nuv_position_t));
- priv->current_position = priv->current_position->next;
- priv->current_position->frame = priv->current_video_frame;
- priv->current_position->time = rtjpeg_frameheader.timecode;
- priv->current_position->offset = orig_pos;
- priv->current_position->next = NULL;
- }
- /* put RTjpeg tables, Video info to video buffer */
- stream_seek ( demuxer->stream, orig_pos );
- ds_read_packet ( demuxer->video, demuxer->stream, rtjpeg_frameheader.packetlength + 12,
- rtjpeg_frameheader.timecode*0.001, orig_pos, 0 );
-
-
- } else
- if (demuxer->audio && (rtjpeg_frameheader.frametype == 'A'))
- {
- priv->current_audio_frame++;
- if (want_audio) {
- /* put Audio to audio buffer */
- ds_read_packet ( demuxer->audio, demuxer->stream,
- rtjpeg_frameheader.packetlength,
- rtjpeg_frameheader.timecode*0.001,
- orig_pos + 12, 0 );
- } else {
- /* skip audio block */
- stream_skip ( demuxer->stream,
- rtjpeg_frameheader.packetlength );
- }
- }
-
- return 1;
-}
-
-/* Scan for the extended data in MythTV nuv streams */
-static int demux_xscan_nuv(demuxer_t* demuxer, int width, int height) {
- int i;
- off_t orig_pos = stream_tell(demuxer->stream);
- struct rtframeheader rtjpeg_frameheader;
- struct extendeddata ext;
- sh_video_t* sh_video = demuxer->video->sh;
- sh_audio_t* sh_audio = demuxer->audio->sh;
-
- for (i = 0; i < 2; ++i) {
- if (stream_read(demuxer->stream, (char*)&rtjpeg_frameheader,
- sizeof(rtjpeg_frameheader)) < sizeof(rtjpeg_frameheader))
- goto out;
- le2me_rtframeheader(&rtjpeg_frameheader);
-
- if (rtjpeg_frameheader.frametype != 'X')
- stream_skip(demuxer->stream, rtjpeg_frameheader.packetlength);
- }
-
- if ( rtjpeg_frameheader.frametype != 'X' )
- goto out;
-
- if (rtjpeg_frameheader.packetlength != sizeof(ext)) {
- mp_msg(MSGT_DEMUXER, MSGL_WARN,
- "NUV extended frame does not have expected length, ignoring\n");
- goto out;
- }
-
- if (stream_read(demuxer->stream, (char*)&ext, sizeof(ext)) < sizeof(ext))
- goto out;
- le2me_extendeddata(&ext);
-
- if (ext.version != 1) {
- mp_msg(MSGT_DEMUXER, MSGL_WARN,
- "NUV extended frame has unknown version number (%d), ignoring\n",
- ext.version);
- goto out;
- }
-
- mp_msg(MSGT_DEMUXER, MSGL_V, "Detected MythTV stream\n");
-
- /* Video parameters */
- mp_msg(MSGT_DEMUXER, MSGL_V, "FOURCC: %c%c%c%c\n",
- (ext.video_fourcc >> 24) & 0xff,
- (ext.video_fourcc >> 16) & 0xff,
- (ext.video_fourcc >> 8) & 0xff,
- (ext.video_fourcc) & 0xff);
- sh_video->format = ext.video_fourcc;
- sh_video->i_bps = ext.lavc_bitrate;
-
- /* Audio parameters */
- if (ext.audio_fourcc == mmioFOURCC('L', 'A', 'M', 'E')) {
- sh_audio->format = 0x55;
- } else if (ext.audio_fourcc == mmioFOURCC('R', 'A', 'W', 'A')) {
- sh_audio->format = 0x1;
- } else {
- mp_msg(MSGT_DEMUXER, MSGL_WARN,
- "Unknown audio format 0x%x\n", ext.audio_fourcc);
- }
-
- sh_audio->channels = ext.audio_channels;
- sh_audio->samplerate = ext.audio_sample_rate;
- sh_audio->i_bps = sh_audio->channels * sh_audio->samplerate *
- ext.audio_bits_per_sample;
- if (sh_audio->format != 0x1)
- sh_audio->i_bps = nearestBitrate(sh_audio->i_bps /
- ext.audio_compression_ratio);
- sh_audio->wf->wFormatTag = sh_audio->format;
- sh_audio->wf->nChannels = sh_audio->channels;
- sh_audio->wf->nSamplesPerSec = sh_audio->samplerate;
- sh_audio->wf->nAvgBytesPerSec = sh_audio->i_bps / 8;
- sh_audio->wf->nBlockAlign = sh_audio->channels * 2;
- sh_audio->wf->wBitsPerSample = ext.audio_bits_per_sample;
- sh_audio->wf->cbSize = 0;
-
- mp_msg(MSGT_DEMUXER, MSGL_V,
- "channels=%d bitspersample=%d samplerate=%d compression_ratio=%d\n",
- ext.audio_channels, ext.audio_bits_per_sample,
- ext.audio_sample_rate, ext.audio_compression_ratio);
- return 1;
-out:
- stream_reset(demuxer->stream);
- stream_seek(demuxer->stream, orig_pos);
- return 0;
-}
-
-static demuxer_t* demux_open_nuv ( demuxer_t* demuxer )
-{
- sh_video_t *sh_video = NULL;
- sh_audio_t *sh_audio = NULL;
- struct rtfileheader rtjpeg_fileheader;
- nuv_priv_t* priv = (nuv_priv_t*) malloc ( sizeof ( nuv_priv_t) );
- demuxer->priv = priv;
- priv->current_audio_frame = 0;
- priv->current_video_frame = 0;
-
-
- /* Go to the start */
- stream_reset(demuxer->stream);
- stream_seek(demuxer->stream, 0);
-
- stream_read ( demuxer->stream, (char*)& rtjpeg_fileheader, sizeof(rtjpeg_fileheader) );
- le2me_rtfileheader(&rtjpeg_fileheader);
-
- /* no video */
- if (rtjpeg_fileheader.videoblocks == 0)
- {
- mp_msg(MSGT_DEMUXER, MSGL_INFO, MSGTR_MPDEMUX_NUV_NoVideoBlocksInFile);
- return NULL;
- }
-
- /* Create a new video stream header */
- sh_video = new_sh_video ( demuxer, 0 );
-
- /* Make sure the demuxer knows about the new video stream header
- * (even though new_sh_video() ought to take care of it)
- */
- demuxer->video->sh = sh_video;
-
- /* Make sure that the video demuxer stream header knows about its
- * parent video demuxer stream (this is getting wacky), or else
- * video_read_properties() will choke
- */
- sh_video->ds = demuxer->video;
-
- /* Custom fourcc for internal MPlayer use */
- sh_video->format = mmioFOURCC('N', 'U', 'V', '1');
-
- sh_video->disp_w = rtjpeg_fileheader.width;
- sh_video->disp_h = rtjpeg_fileheader.height;
-
- /* NuppelVideo uses pixel aspect ratio
- here display aspect ratio is used.
- For the moment NuppelVideo only supports 1.0 thus
- 1.33 == 4:3 aspect ratio.
- */
- if(rtjpeg_fileheader.aspect == 1.0)
- sh_video->aspect = (float) 4.0f/3.0f;
-
- /* Get the FPS */
- sh_video->fps = rtjpeg_fileheader.fps;
- sh_video->frametime = 1 / sh_video->fps;
-
- if (rtjpeg_fileheader.audioblocks != 0)
- {
- sh_audio = new_sh_audio(demuxer, 0);
- demuxer->audio->id = 0;
- demuxer->audio->sh = sh_audio;
- sh_audio->ds = demuxer->audio;
- sh_audio->format = 0x1;
- sh_audio->channels = 2;
- sh_audio->samplerate = 44100;
-
- sh_audio->wf = malloc(sizeof(WAVEFORMATEX));
- memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX));
- sh_audio->wf->wFormatTag = sh_audio->format;
- sh_audio->wf->nChannels = sh_audio->channels;
- sh_audio->wf->wBitsPerSample = 16;
- sh_audio->wf->nSamplesPerSec = sh_audio->samplerate;
- sh_audio->wf->nAvgBytesPerSec = sh_audio->wf->nChannels*
- sh_audio->wf->wBitsPerSample*sh_audio->wf->nSamplesPerSec/8;
- sh_audio->wf->nBlockAlign = sh_audio->channels * 2;
- sh_audio->wf->cbSize = 0;
- }
-
- /* Check for extended data (X frame) and read settings from it */
- if (!demux_xscan_nuv(demuxer, rtjpeg_fileheader.width,
- rtjpeg_fileheader.height))
- /* Otherwise assume defaults */
- mp_msg(MSGT_DEMUXER, MSGL_V, "No NUV extended frame, using defaults\n");
-
-
- priv->index_list = (nuv_position_t*) malloc(sizeof(nuv_position_t));
- priv->index_list->frame = 0;
- priv->index_list->time = 0;
- priv->index_list->offset = stream_tell ( demuxer->stream );
- priv->index_list->next = NULL;
- priv->current_position = priv->index_list;
-
- return demuxer;
-}
-
-static int nuv_check_file ( demuxer_t* demuxer )
-{
- struct nuv_signature ns;
-
- /* Store original position */
- off_t orig_pos = stream_tell(demuxer->stream);
-
- mp_msg ( MSGT_DEMUX, MSGL_V, "Checking for NuppelVideo\n" );
-
- if(stream_read(demuxer->stream,(char*)&ns,sizeof(ns)) != sizeof(ns))
- return 0;
-
- if ( strncmp ( ns.finfo, "NuppelVideo", 12 ) &&
- strncmp ( ns.finfo, "MythTVVideo", 12 ) )
- return 0; /* Not a NuppelVideo file */
- if ( strncmp ( ns.version, "0.05", 5 ) &&
- strncmp ( ns.version, "0.06", 5 ) &&
- strncmp ( ns.version, "0.07", 5 ) )
- return 0; /* Wrong version NuppelVideo file */
-
- /* Return to original position */
- stream_seek ( demuxer->stream, orig_pos );
- return DEMUXER_TYPE_NUV;
-}
-
-static void demux_close_nuv(demuxer_t* demuxer) {
- nuv_priv_t* priv = demuxer->priv;
- nuv_position_t* pos;
- if(!priv)
- return;
- for(pos = priv->index_list ; pos != NULL ; ) {
- nuv_position_t* p = pos;
- pos = pos->next;
- free(p);
- }
- free(priv);
-}
-
-
-const demuxer_desc_t demuxer_desc_nuv = {
- "NuppelVideo demuxer",
- "nuv",
- "NuppelVideo",
- "Panagiotis Issaris",
- "",
- DEMUXER_TYPE_NUV,
- 1, // safe autodetect
- nuv_check_file,
- demux_nuv_fill_buffer,
- demux_open_nuv,
- demux_close_nuv,
- demux_seek_nuv,
- NULL
-};
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index 6c3792b1d9..4347feee0b 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -46,7 +46,6 @@ extern const demuxer_desc_t demuxer_desc_mf;
extern const demuxer_desc_t demuxer_desc_avi;
extern const demuxer_desc_t demuxer_desc_y4m;
extern const demuxer_desc_t demuxer_desc_asf;
-extern const demuxer_desc_t demuxer_desc_nuv;
extern const demuxer_desc_t demuxer_desc_real;
extern const demuxer_desc_t demuxer_desc_smjpeg;
extern const demuxer_desc_t demuxer_desc_matroska;
@@ -101,7 +100,6 @@ const demuxer_desc_t *const demuxer_list[] = {
&demuxer_desc_y4m,
&demuxer_desc_asf,
&demuxer_desc_nsv,
- &demuxer_desc_nuv,
&demuxer_desc_real,
&demuxer_desc_smjpeg,
&demuxer_desc_matroska,
diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h
index f7f69a9fb7..4815c8b7d9 100644
--- a/libmpdemux/demuxer.h
+++ b/libmpdemux/demuxer.h
@@ -34,7 +34,6 @@ struct MPOpts;
#define DEMUXER_TYPE_FLI 10
#define DEMUXER_TYPE_REAL 11
#define DEMUXER_TYPE_Y4M 12
-#define DEMUXER_TYPE_NUV 13
#define DEMUXER_TYPE_FILM 14
#define DEMUXER_TYPE_ROQ 15
#define DEMUXER_TYPE_MF 16
diff --git a/libmpdemux/nuppelvideo.h b/libmpdemux/nuppelvideo.h
deleted file mode 100644
index e12c1eb325..0000000000
--- a/libmpdemux/nuppelvideo.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- nuppelvideo.h taken from NuppelVideo, by
- (c) Roman Hochleitner roman@mars.tuwien.ac.at
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef MPLAYER_NUPPELVIDEO_H
-#define MPLAYER_NUPPELVIDEO_H
-
-#include "libavutil/intfloat_readwrite.h"
-
-typedef struct __attribute__((packed)) rtfileheader
-{
- char finfo[12]; // "NuppelVideo" + \0
- char version[5]; // "0.05" + \0
- char pad1[3];
- int width;
- int height;
- int desiredwidth; // 0 .. as it is
- int desiredheight; // 0 .. as it is
- char pimode; // P .. progressive
- // I .. interlaced (2 half pics) [NI]
- char pad2[3];
- double aspect; // 1.0 .. square pixel (1.5 .. e.g. width=480: width*1.5=720
- // for capturing for svcd material
- double fps;
- int videoblocks; // count of video-blocks -1 .. unknown 0 .. no video
- int audioblocks; // count of audio-blocks -1 .. unknown 0 .. no audio
- int textsblocks; // count of text-blocks -1 .. unknown 0 .. no text
- int keyframedist;
-} rtfileheader;
-
-typedef struct __attribute__((packed)) rtframeheader
-{
- char frametype; // A .. Audio, V .. Video, S .. Sync, T .. Text
- // R .. Seekpoint: String RTjjjjjjjj (use full packet)
- // D .. Addition Data for Compressors
- // ct: R .. RTjpeg Tables
-
- char comptype; // V: 0 .. Uncompressed [NI]
- // 1 .. RTJpeg
- // 2 .. RTJpeg with lzo afterwards
- // N .. black frame
- // L .. simply copy last frame (if lost frames)
- // A: 0 .. Uncompressed (44100/sec 16bit 2ch)
- // 1 .. lzo compression [NI]
- // 2 .. layer2 (packet) [NI]
- // 3 .. layer3 (packet) [NI]
- // F .. flac (lossless) [NI]
- // S .. shorten (lossless) [NI]
- // N .. null frame loudless
- // L .. simply copy last frame (may sound bad) NI
- // S: B .. Audio and Video sync point [NI]
- // A .. Audio Sync Information
- // timecode == effective dsp-frequency*100
- // when reaching this audio sync point
- // because many cheap soundcards are unexact
- // and have a range from 44000 to 44250
- // instead of the expected exact 44100 S./sec
- // V .. Next Video Sync
- // timecode == next video framenumber
- // S .. Audio,Video,Text Correlation [NI]
- char keyframe; // 0 .. keyframe
- // 1 .. nr of frame in gop => no keyframe
-
- char filters; // Every bit stands for one type of filter
- // 1 .. Gauss 5 Pixel (8*m+2*l+2*r+2*a+2*b)/16 [NYI]
- // 2 .. Gauss 5 Pixel (8*m+1*l+1*r+1*a+1*b)/12 [NYI]
- // 4 .. Cartoon Filter [NI]
- // 8 .. Reserverd Filter [NI]
- // 16 .. Reserverd Filter [NI]
- // 32 .. Reserverd Filter [NI]
- // 64 .. Reserverd Filter [NI]
- // 128 .. Reserverd Filter [NI]
-
- int timecode; // Timecodeinformation sec*1000 + msecs
-
- int packetlength; // V,A,T: length of following data in stream
- // S: length of packet correl. information [NI]
- // R: do not use here! (fixed 'RTjjjjjjjjjjjjjj')
-} rtframeheader;
-
-/* for MythTV */
-typedef struct __attribute__((packed)) extendeddata
-{
- int version; // yes, this is repeated from the file header
- int video_fourcc; // video encoding method used
- int audio_fourcc; // audio encoding method used
- // generic data
- int audio_sample_rate;
- int audio_bits_per_sample;
- int audio_channels;
- // codec specific
- // mp3lame
- int audio_compression_ratio;
- int audio_quality;
- // rtjpeg
- int rtjpeg_quality;
- int rtjpeg_luma_filter;
- int rtjpeg_chroma_filter;
- // libavcodec
- int lavc_bitrate;
- int lavc_qmin;
- int lavc_qmax;
- int lavc_maxqdiff;
- // unused for later -- total size of 128 integers.
- // new fields must be added at the end, above this comment.
- int expansion[113];
-} extendeddata;
-
-#define FRAMEHEADERSIZE sizeof(rtframeheader)
-#define FILEHEADERSIZE sizeof(rtfileheader)
-
-typedef struct vidbuffertype
-{
- int sample;
- int timecode;
- int freeToEncode;
- int freeToBuffer;
- unsigned char *buffer_offset;
-} vidbuffertyp;
-
-typedef struct audbuffertype
-{
- int sample;
- int timecode;
- int freeToEncode;
- int freeToBuffer;
- unsigned char *buffer_offset;
-} audbuffertyp;
-
-#define le2me_rtfileheader(h) { \
- (h)->width = le2me_32((h)->width); \
- (h)->height = le2me_32((h)->height); \
- (h)->desiredwidth = le2me_32((h)->desiredwidth); \
- (h)->desiredheight = le2me_32((h)->desiredheight); \
- (h)->aspect = av_int2dbl(le2me_64(*(uint64_t *)&(h)->aspect));\
- (h)->fps = av_int2dbl(le2me_64(*(uint64_t *)&(h)->fps)); \
- (h)->videoblocks = le2me_32((h)->videoblocks); \
- (h)->audioblocks = le2me_32((h)->audioblocks); \
- (h)->textsblocks = le2me_32((h)->textsblocks); \
- (h)->keyframedist = le2me_32((h)->keyframedist); \
- }
-#define le2me_rtframeheader(h) { \
- (h)->timecode = le2me_32((h)->timecode); \
- (h)->packetlength = le2me_32((h)->packetlength); \
- }
-#define le2me_extendeddata(h) { \
- (h)->version = le2me_32((h)->version); \
- (h)->video_fourcc = le2me_32((h)->video_fourcc); \
- (h)->audio_fourcc = le2me_32((h)->audio_fourcc); \
- (h)->audio_sample_rate = le2me_32((h)->audio_sample_rate); \
- (h)->audio_bits_per_sample = le2me_32((h)->audio_bits_per_sample);\
- (h)->audio_channels = le2me_32((h)->audio_channels); \
- (h)->audio_compression_ratio = le2me_32((h)->audio_compression_ratio);\
- (h)->audio_quality = le2me_32((h)->audio_quality); \
- (h)->rtjpeg_quality = le2me_32((h)->rtjpeg_quality); \
- (h)->rtjpeg_luma_filter = le2me_32((h)->rtjpeg_luma_filter); \
- (h)->rtjpeg_chroma_filter = le2me_32((h)->rtjpeg_chroma_filter);\
- (h)->lavc_bitrate = le2me_32((h)->lavc_bitrate); \
- (h)->lavc_qmin = le2me_32((h)->lavc_qmin); \
- (h)->lavc_qmax = le2me_32((h)->lavc_qmax); \
- (h)->lavc_maxqdiff = le2me_32((h)->lavc_maxqdiff); \
- }
-
-#endif /* MPLAYER_NUPPELVIDEO_H */