| 1 | /********** |
| 2 | This library is free software; you can redistribute it and/or modify it under |
| 3 | the terms of the GNU Lesser General Public License as published by the |
| 4 | Free Software Foundation; either version 3 of the License, or (at your |
| 5 | option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) |
| 6 | |
| 7 | This library is distributed in the hope that it will be useful, but WITHOUT |
| 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for |
| 10 | more details. |
| 11 | |
| 12 | You should have received a copy of the GNU Lesser General Public License |
| 13 | along with this library; if not, write to the Free Software Foundation, Inc., |
| 14 | 51 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 | |
| 25 | MediaSource::MediaSource(UsageEnvironment& env) |
| 26 | : Medium(env) { |
| 27 | } |
| 28 | |
| 29 | MediaSource::~MediaSource() { |
| 30 | } |
| 31 | |
| 32 | Boolean MediaSource::isSource() const { |
| 33 | return True; |
| 34 | } |
| 35 | |
| 36 | char const* MediaSource::MIMEtype() const { |
| 37 | return "application/OCTET-STREAM" ; // default type |
| 38 | } |
| 39 | |
| 40 | Boolean MediaSource::isFramedSource() const { |
| 41 | return False; // default implementation |
| 42 | } |
| 43 | Boolean MediaSource::isRTPSource() const { |
| 44 | return False; // default implementation |
| 45 | } |
| 46 | Boolean MediaSource::isMPEG1or2VideoStreamFramer() const { |
| 47 | return False; // default implementation |
| 48 | } |
| 49 | Boolean MediaSource::isMPEG4VideoStreamFramer() const { |
| 50 | return False; // default implementation |
| 51 | } |
| 52 | Boolean MediaSource::isH264VideoStreamFramer() const { |
| 53 | return False; // default implementation |
| 54 | } |
| 55 | Boolean MediaSource::isH265VideoStreamFramer() const { |
| 56 | return False; // default implementation |
| 57 | } |
| 58 | Boolean MediaSource::isDVVideoStreamFramer() const { |
| 59 | return False; // default implementation |
| 60 | } |
| 61 | Boolean MediaSource::isJPEGVideoSource() const { |
| 62 | return False; // default implementation |
| 63 | } |
| 64 | Boolean MediaSource::isAMRAudioSource() const { |
| 65 | return False; // default implementation |
| 66 | } |
| 67 | Boolean MediaSource::isMPEG2TransportStreamMultiplexor() const { |
| 68 | return False; // default implementation |
| 69 | } |
| 70 | |
| 71 | Boolean 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 | |
| 88 | void MediaSource::getAttributes() const { |
| 89 | // Default implementation |
| 90 | envir().setResultMsg("" ); |
| 91 | } |
| 92 | |