Changeset 1916 for trunk/src/objects


Ignore:
Timestamp:
Oct 6, 2010 6:58:50 AM (14 years ago)
Author:
dkearney
Message:

switching from RpMediaPlayer? to RpVideo? code for the video viewer widget. changed flowdial widget so the dial moved as needed for the video widget.

Location:
trunk/src/objects
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/objects/Makefile.in

    r1887 r1916  
    116116  # include them in compilation
    117117  LIBS += -lavcodec -lavformat -lswscale
    118   HEADERS += RpMediaPlayer.h
    119   OBJS += RpMediaPlayer.o
     118  # HEADERS += RpMediaPlayer.h RpVideo.h
     119  # OBJS += RpMediaPlayer.o RpVideo.o
     120  HEADERS += RpVideo.h
     121  OBJS += RpVideo.o
    120122endif
    121123
  • trunk/src/objects/RpMediaPlayer.cc

    r1873 r1916  
    226226    return 0;
    227227}
     228/*
     229int packet_queue_put(PacketQueue *q, AVPacket *pkt) {
     230
     231  AVPacketList *pkt1;
     232  if(pkt != &flush_pkt && av_dup_packet(pkt) < 0) {
     233    return -1;
     234  }
     235    if(packet_queue_get(&is->audioq, pkt, 1) < 0) {
     236      return -1;
     237    }
     238    if(packet->data == flush_pkt.data) {
     239      avcodec_flush_buffers(is->audio_st->codec);
     240      continue;
     241    }
     242*/
     243
    228244
    229245int
     
    231247{
    232248    // status.addContext("Rappture::MediaPlayer::seek()");
     249    int stream_index= -1;
     250    int64_t seek_target = is->seek_pos;
     251
     252    if (is->videoStream >= 0) {
     253        stream_index = is->videoStream;
     254    } else if (is->audioStream >= 0) {
     255        stream_index = is->audioStream;
     256    }
     257
     258    if(stream_index>=0){
     259        seek_target= av_rescale_q(seek_target, AV_TIME_BASE_Q,
     260                      pFormatCtx->streams[stream_index]->time_base);
     261    }
     262    if(av_seek_frame(is->pFormatCtx, stream_index,
     263                    seek_target, is->seek_flags) < 0) {
     264        fprintf(stderr, "%s: error while seeking\n",
     265            is->pFormatCtx->filename);
     266    } else {
     267        /* handle packet queues... more later... */
     268        if(is->audioStream >= 0) {
     269            packet_queue_flush(&is->audioq);
     270            packet_queue_put(&is->audioq, &flush_pkt);
     271        }
     272        if(is->videoStream >= 0) {
     273            packet_queue_flush(&is->videoq);
     274            packet_queue_put(&is->videoq, &flush_pkt);
     275        }
     276    }
     277    is->seek_req = 0;
    233278    return 0;
    234279}
Note: See TracChangeset for help on using the changeset viewer.