liveMedia/MediaSource.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-2013 Live Networks, Inc.  All rights reserved.
00018 // Media Sources
00019 // Implementation
00020 
00021 #include "MediaSource.hh"
00022 
00024 
00025 MediaSource::MediaSource(UsageEnvironment& env)
00026         : Medium(env) {
00027 }
00028 
00029 MediaSource::~MediaSource() {
00030 }
00031 
00032 Boolean MediaSource::isSource() const {
00033   return True;
00034 }
00035 
00036 char const* MediaSource::MIMEtype() const {
00037   return "application/OCTET-STREAM"; // default type
00038 }
00039 
00040 Boolean MediaSource::isFramedSource() const {
00041   return False; // default implementation
00042 }
00043 Boolean MediaSource::isRTPSource() const {
00044   return False; // default implementation
00045 }
00046 Boolean MediaSource::isMPEG1or2VideoStreamFramer() const {
00047   return False; // default implementation
00048 }
00049 Boolean MediaSource::isMPEG4VideoStreamFramer() const {
00050   return False; // default implementation
00051 }
00052 Boolean MediaSource::isH264VideoStreamFramer() const {
00053   return False; // default implementation
00054 }
00055 Boolean MediaSource::isDVVideoStreamFramer() const {
00056   return False; // default implementation
00057 }
00058 Boolean MediaSource::isJPEGVideoSource() const {
00059   return False; // default implementation
00060 }
00061 Boolean MediaSource::isAMRAudioSource() const {
00062   return False; // default implementation
00063 }
00064 
00065 Boolean MediaSource::lookupByName(UsageEnvironment& env,
00066                                   char const* sourceName,
00067                                   MediaSource*& resultSource) {
00068   resultSource = NULL; // unless we succeed
00069 
00070   Medium* medium;
00071   if (!Medium::lookupByName(env, sourceName, medium)) return False;
00072 
00073   if (!medium->isSource()) {
00074     env.setResultMsg(sourceName, " is not a media source");
00075     return False;
00076   }
00077 
00078   resultSource = (MediaSource*)medium;
00079   return True;
00080 }
00081 
00082 void MediaSource::getAttributes() const {
00083   // Default implementation
00084   envir().setResultMsg("");
00085 }

Generated on Mon Apr 29 13:28:01 2013 for live by  doxygen 1.5.2