liveMedia/MPEG4ESVideoRTPSource.cpp

Go to the documentation of this file.
00001 /**********
00002 This library is free software; you can redistribute it and/or modify it under
00003 the terms of the GNU Lesser General Public License as published by the
00004 Free Software Foundation; either version 2.1 of the License, or (at your
00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT
00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009 FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
00010 more details.
00011 
00012 You should have received a copy of the GNU Lesser General Public License
00013 along with this library; if not, write to the Free Software Foundation, Inc.,
00014 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015 **********/
00016 // "liveMedia"
00017 // Copyright (c) 1996-2012 Live Networks, Inc.  All rights reserved.
00018 // MP4V-ES video RTP stream sources
00019 // Implementation
00020 
00021 #include "MPEG4ESVideoRTPSource.hh"
00022 
00024 
00025 //##### NOTE: INCOMPLETE!!! #####
00026 
00027 MPEG4ESVideoRTPSource*
00028 MPEG4ESVideoRTPSource::createNew(UsageEnvironment& env, Groupsock* RTPgs,
00029                                    unsigned char rtpPayloadFormat,
00030                                    unsigned rtpTimestampFrequency) {
00031   return new MPEG4ESVideoRTPSource(env, RTPgs, rtpPayloadFormat,
00032                                    rtpTimestampFrequency);
00033 }
00034 
00035 MPEG4ESVideoRTPSource
00036 ::MPEG4ESVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
00037                         unsigned char rtpPayloadFormat,
00038                         unsigned rtpTimestampFrequency)
00039   : MultiFramedRTPSource(env, RTPgs,
00040                          rtpPayloadFormat, rtpTimestampFrequency) {
00041 }
00042 
00043 MPEG4ESVideoRTPSource::~MPEG4ESVideoRTPSource() {
00044 }
00045 
00046 Boolean MPEG4ESVideoRTPSource
00047 ::processSpecialHeader(BufferedPacket* packet,
00048                        unsigned& resultSpecialHeaderSize) {
00049   // The packet begins a frame iff its data begins with a system code
00050   // (i.e., 0x000001??)
00051   fCurrentPacketBeginsFrame
00052     = packet->dataSize() >= 4 && (packet->data())[0] == 0
00053     && (packet->data())[1] == 0 && (packet->data())[2] == 1;
00054 
00055   // The RTP "M" (marker) bit indicates the last fragment of a frame:
00056   fCurrentPacketCompletesFrame = packet->rtpMarkerBit();
00057 
00058   // There is no special header
00059   resultSpecialHeaderSize = 0;
00060   return True;
00061 }
00062 
00063 char const* MPEG4ESVideoRTPSource::MIMEtype() const {
00064   return "video/MP4V-ES";
00065 }

Generated on Thu May 17 07:11:47 2012 for live by  doxygen 1.5.2