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 | // JPEG video sources |
19 | // C++ header |
20 | |
21 | #ifndef _JPEG_VIDEO_SOURCE_HH |
22 | #define _JPEG_VIDEO_SOURCE_HH |
23 | |
24 | #ifndef _FRAMED_SOURCE_HH |
25 | #include "FramedSource.hh" |
26 | #endif |
27 | |
28 | class JPEGVideoSource: public FramedSource { |
29 | public: |
30 | virtual u_int8_t type() = 0; |
31 | virtual u_int8_t qFactor() = 0; |
32 | virtual u_int8_t width() = 0; // # pixels/8 (or 0 for 2048 pixels) |
33 | virtual u_int8_t height() = 0; // # pixels/8 (or 0 for 2048 pixels) |
34 | |
35 | virtual u_int8_t const* quantizationTables(u_int8_t& precision, |
36 | u_int16_t& length); |
37 | // If "qFactor()" returns a value >= 128, then this function is called |
38 | // to tell us the quantization tables that are being used. |
39 | // (The default implementation of this function just returns NULL.) |
40 | // "precision" and "length" are as defined in RFC 2435, section 3.1.8. |
41 | |
42 | virtual u_int16_t restartInterval(); |
43 | // If restart intervals are being used (i.e., 64 <= type() <= 127), then this function must be |
44 | // redefined - by a subclass - to return a non-zero value. |
45 | |
46 | protected: |
47 | JPEGVideoSource(UsageEnvironment& env); // abstract base class |
48 | virtual ~JPEGVideoSource(); |
49 | |
50 | private: |
51 | // redefined virtual functions: |
52 | virtual Boolean isJPEGVideoSource() const; |
53 | }; |
54 | |
55 | #endif |
56 | |