[Redbutton-devel] SF.net SVN: redbutton: [84] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-06-02 11:01:54
|
Revision: 84 Author: skilvington Date: 2006-06-02 04:01:46 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=84&view=rev Log Message: ----------- pass the AudioClass to the stream player Modified Paths: -------------- redbutton-browser/trunk/MHEGStreamPlayer.c redbutton-browser/trunk/MHEGStreamPlayer.h redbutton-browser/trunk/StreamComponent.c Modified: redbutton-browser/trunk/MHEGStreamPlayer.c =================================================================== --- redbutton-browser/trunk/MHEGStreamPlayer.c 2006-05-31 13:35:40 UTC (rev 83) +++ redbutton-browser/trunk/MHEGStreamPlayer.c 2006-06-02 11:01:46 UTC (rev 84) @@ -66,6 +66,7 @@ p->have_audio = false; p->video = NULL; + p->audio = NULL; pthread_mutex_init(&p->videoq_lock, NULL); p->videoq_len = 0; @@ -85,30 +86,37 @@ } void -MHEGStreamPlayer_setVideoTag(MHEGStreamPlayer *p, VideoClass *video, int tag) +MHEGStreamPlayer_setVideoStream(MHEGStreamPlayer *p, VideoClass *video) { if(p->have_video) - error("MHEGStreamPlayer: more than one video stream; only using the last one (%d)", tag); + error("MHEGStreamPlayer: more than one video stream; only using the last one (%d)", video->component_tag); p->have_video = true; - p->video_tag = tag; - p->video_pid = -1; - p->video_type = -1; /* output size/position */ p->video = video; + /* the backend will tell us the PID and stream type when we start streaming it */ + p->video_tag = video->component_tag; + p->video_pid = -1; + p->video_type = -1; + return; } void -MHEGStreamPlayer_setAudioTag(MHEGStreamPlayer *p, int tag) +MHEGStreamPlayer_setAudioStream(MHEGStreamPlayer *p, AudioClass *audio) { if(p->have_audio) - error("MHEGStreamPlayer: more than one audio stream; only using the last one (%d)", tag); + error("MHEGStreamPlayer: more than one audio stream; only using the last one (%d)", audio->component_tag); p->have_audio = true; - p->audio_tag = tag; + + /* volume */ + p->audio = audio; + + /* the backend will tell us the PID and stream type when we start streaming it */ + p->audio_tag = audio->component_tag; p->audio_pid = -1; p->audio_type = -1; Modified: redbutton-browser/trunk/MHEGStreamPlayer.h =================================================================== --- redbutton-browser/trunk/MHEGStreamPlayer.h 2006-05-31 13:35:40 UTC (rev 83) +++ redbutton-browser/trunk/MHEGStreamPlayer.h 2006-06-02 11:01:46 UTC (rev 84) @@ -39,6 +39,8 @@ bool stop; /* true => stop playback */ bool have_video; /* false if we have no video stream */ bool have_audio; /* false if we have no audio stream */ + VideoClass *video; /* output size/position, maybe NULL if audio only */ + AudioClass *audio; /* output volume, maybe NULL if video only */ int video_tag; /* video stream component tag (-1 => default for current service ID) */ int video_pid; /* PID in MPEG Transport Stream (-1 => not yet known) */ int video_type; /* video stream type (-1 => not yet known) */ @@ -46,7 +48,6 @@ int audio_pid; /* PID in MPEG Transport Stream (-1 => not yet known) */ int audio_type; /* audio stream type (-1 => not yet known) */ FILE *ts; /* MPEG Transport Stream */ - VideoClass *video; /* output size/position, maybe NULL if audio only */ pthread_t decode_tid; /* thread decoding the MPEG stream into frames */ pthread_t video_tid; /* thread displaying frames on the screen */ pthread_mutex_t videoq_lock; /* list of decoded video frames */ @@ -57,8 +58,8 @@ void MHEGStreamPlayer_init(MHEGStreamPlayer *); void MHEGStreamPlayer_fini(MHEGStreamPlayer *); -void MHEGStreamPlayer_setVideoTag(MHEGStreamPlayer *, VideoClass *, int); -void MHEGStreamPlayer_setAudioTag(MHEGStreamPlayer *, int); +void MHEGStreamPlayer_setVideoStream(MHEGStreamPlayer *, VideoClass *); +void MHEGStreamPlayer_setAudioStream(MHEGStreamPlayer *, AudioClass *); void MHEGStreamPlayer_play(MHEGStreamPlayer *); void MHEGStreamPlayer_stop(MHEGStreamPlayer *); Modified: redbutton-browser/trunk/StreamComponent.c =================================================================== --- redbutton-browser/trunk/StreamComponent.c 2006-05-31 13:35:40 UTC (rev 83) +++ redbutton-browser/trunk/StreamComponent.c 2006-06-02 11:01:46 UTC (rev 84) @@ -105,11 +105,11 @@ switch(s->choice) { case StreamComponent_audio: - MHEGStreamPlayer_setAudioTag(player, s->u.audio.component_tag); + MHEGStreamPlayer_setAudioStream(player, &s->u.audio); break; case StreamComponent_video: - MHEGStreamPlayer_setVideoTag(player, &s->u.video, s->u.video.component_tag); + MHEGStreamPlayer_setVideoStream(player, &s->u.video); break; case StreamComponent_rtgraphics: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |