1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// "liveMedia"
17// Copyright (c) 1996-2020 Live Networks, Inc. All rights reserved.
18// MP4V-ES video RTP stream sources
19// Implementation
20
21#include "MPEG4ESVideoRTPSource.hh"
22
23///////// MPEG4ESVideoRTPSource implementation ////////
24
25//##### NOTE: INCOMPLETE!!! #####
26
27MPEG4ESVideoRTPSource*
28MPEG4ESVideoRTPSource::createNew(UsageEnvironment& env, Groupsock* RTPgs,
29 unsigned char rtpPayloadFormat,
30 unsigned rtpTimestampFrequency) {
31 return new MPEG4ESVideoRTPSource(env, RTPgs, rtpPayloadFormat,
32 rtpTimestampFrequency);
33}
34
35MPEG4ESVideoRTPSource
36::MPEG4ESVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
37 unsigned char rtpPayloadFormat,
38 unsigned rtpTimestampFrequency)
39 : MultiFramedRTPSource(env, RTPgs,
40 rtpPayloadFormat, rtpTimestampFrequency) {
41}
42
43MPEG4ESVideoRTPSource::~MPEG4ESVideoRTPSource() {
44}
45
46Boolean MPEG4ESVideoRTPSource
47::processSpecialHeader(BufferedPacket* packet,
48 unsigned& resultSpecialHeaderSize) {
49 // The packet begins a frame iff its data begins with a system code
50 // (i.e., 0x000001??)
51 fCurrentPacketBeginsFrame
52 = packet->dataSize() >= 4 && (packet->data())[0] == 0
53 && (packet->data())[1] == 0 && (packet->data())[2] == 1;
54
55 // The RTP "M" (marker) bit indicates the last fragment of a frame:
56 fCurrentPacketCompletesFrame = packet->rtpMarkerBit();
57
58 // There is no special header
59 resultSpecialHeaderSize = 0;
60 return True;
61}
62
63char const* MPEG4ESVideoRTPSource::MIMEtype() const {
64 return "video/MP4V-ES";
65}
66