live
liveMedia
include
MediaTranscodingTable.hh
Go to the documentation of this file.
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-2024 Live Networks, Inc. All rights reserved.
18
// A class that implements a database that can be accessed to create
19
// "FramedFilter" (subclass) objects that transcode one codec into another.
20
// The implementation of this class just returns NULL for each codec lookup;
21
// To actually implement transcoding, you would subclass it.
22
// C++ header
23
24
#ifndef _MEDIA_TRANSCODING_TABLE_HH
25
#define _MEDIA_TRANSCODING_TABLE_HH
26
27
#ifndef _FRAMED_FILTER_HH
28
#include "
FramedFilter.hh
"
29
#endif
30
#ifndef _MEDIA_SESSION_HH
31
#include "
MediaSession.hh
"
32
#endif
33
34
class
MediaTranscodingTable
:
public
Medium
{
35
public
:
36
virtual
FramedFilter
*
37
lookupTranscoder
(
MediaSubsession
&
/*inputCodecDescription*/
,
// in
38
char
*& outputCodecName
/* out; must be delete[]d later */
) {
39
// Default implementation: Return NULL (indicating: no transcoding).
40
// You would reimplement this virtual function in a subclass to return a new 'transcoding'
41
// "FramedFilter" (subclass) object for each ("mediumName","codecName") that you wish to
42
// transcode (or return NULL for no transcoding).
43
// (Note that "inputCodecDescription" must have a non-NULL "readSource()"; this is used
44
// as the input to the new "FramedFilter" (subclass) object.)
45
outputCodecName =
NULL
;
46
return
NULL
;
47
}
48
49
virtual
Boolean
weWillTranscode
(
char
const
*
/*mediumName*/
,
char
const
*
/*codecName*/
) {
50
// Default implementation: Return False.
51
// You would reimplement this in a subclass - returning True for each
52
// <mediumName>/<codecName> for which you'll do transcoding.
53
// Note: Unlike "lookupTranscoder()", this function does not actually create any 'transcoding'
54
// filter objects. (It may be called before "MediaSubsession::initiate()".)
55
return
False
;
56
}
57
58
protected
:
// we are to be subclassed only
59
MediaTranscodingTable
(
UsageEnvironment
& env)
60
:
Medium
(env) {
61
}
62
virtual
~MediaTranscodingTable
() {
63
}
64
};
65
66
#endif
False
const Boolean False
Definition:
Boolean.hh:28
Boolean
unsigned char Boolean
Definition:
Boolean.hh:25
FramedFilter.hh
MediaSession.hh
NULL
#define NULL
Definition:
UsageEnvironment.hh:41
FramedFilter
Definition:
FramedFilter.hh:28
MediaSubsession
Definition:
MediaSession.hh:171
MediaTranscodingTable
Definition:
MediaTranscodingTable.hh:34
MediaTranscodingTable::lookupTranscoder
virtual FramedFilter * lookupTranscoder(MediaSubsession &, char *&outputCodecName)
Definition:
MediaTranscodingTable.hh:37
MediaTranscodingTable::MediaTranscodingTable
MediaTranscodingTable(UsageEnvironment &env)
Definition:
MediaTranscodingTable.hh:59
MediaTranscodingTable::weWillTranscode
virtual Boolean weWillTranscode(char const *, char const *)
Definition:
MediaTranscodingTable.hh:49
MediaTranscodingTable::~MediaTranscodingTable
virtual ~MediaTranscodingTable()
Definition:
MediaTranscodingTable.hh:62
Medium
Definition:
Media.hh:50
UsageEnvironment
Definition:
UsageEnvironment.hh:53
Generated on Tue Jun 25 2024 22:52:35 for live by
1.9.5