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// Media Sources
19// Implementation
20
21#include "MediaSource.hh"
22
23////////// MediaSource //////////
24
25MediaSource::MediaSource(UsageEnvironment& env)
26 : Medium(env) {
27}
28
29MediaSource::~MediaSource() {
30}
31
32Boolean MediaSource::isSource() const {
33 return True;
34}
35
36char const* MediaSource::MIMEtype() const {
37 return "application/OCTET-STREAM"; // default type
38}
39
40Boolean MediaSource::isFramedSource() const {
41 return False; // default implementation
42}
43Boolean MediaSource::isRTPSource() const {
44 return False; // default implementation
45}
46Boolean MediaSource::isMPEG1or2VideoStreamFramer() const {
47 return False; // default implementation
48}
49Boolean MediaSource::isMPEG4VideoStreamFramer() const {
50 return False; // default implementation
51}
52Boolean MediaSource::isH264VideoStreamFramer() const {
53 return False; // default implementation
54}
55Boolean MediaSource::isH265VideoStreamFramer() const {
56 return False; // default implementation
57}
58Boolean MediaSource::isDVVideoStreamFramer() const {
59 return False; // default implementation
60}
61Boolean MediaSource::isJPEGVideoSource() const {
62 return False; // default implementation
63}
64Boolean MediaSource::isAMRAudioSource() const {
65 return False; // default implementation
66}
67Boolean MediaSource::isMPEG2TransportStreamMultiplexor() const {
68 return False; // default implementation
69}
70
71Boolean MediaSource::lookupByName(UsageEnvironment& env,
72 char const* sourceName,
73 MediaSource*& resultSource) {
74 resultSource = NULL; // unless we succeed
75
76 Medium* medium;
77 if (!Medium::lookupByName(env, sourceName, medium)) return False;
78
79 if (!medium->isSource()) {
80 env.setResultMsg(sourceName, " is not a media source");
81 return False;
82 }
83
84 resultSource = (MediaSource*)medium;
85 return True;
86}
87
88void MediaSource::getAttributes() const {
89 // Default implementation
90 envir().setResultMsg("");
91}
92