1 /******************************************************************************
2 * FOBS Video API test application
3 * Copyright (c) 2004 Omnividea Multimedia S.L
4 * Coded by JosŽ San Pedro Wandelmer
6 * This file is part of FOBS.
8 * FOBS is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
13 * FOBS is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FOBS; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 ******************************************************************************/
28 using namespace omnividea::fobs
;
32 int main(int argc
, char *argv
[])
35 cout
<< "Syntax: " << argv
[0] << " inputfile" << endl
;
40 clock_t time0
= clock();
43 int max_iterations
= 10;
44 for(;iteration
<max_iterations
;iteration
++)
46 ReturnCode error
= d
.open();
49 cout
<< "Video info: Width=" << d
.getWidth() << " Height=" << d
.getHeight() << " BitRate=" << d
.getBitRate() << " FrameRate="<< d
.getFrameRate() << endl
;
50 if(d
.isAudioPresent())
51 cout
<< "Audio info: SampleRate=" << d
.getAudioSampleRate() << " BitRate=" << d
.getAudioBitRate() << " Channels=" << d
.getAudioChannelNumber() << endl
;
52 error
= d
.nextFrame();
53 cout
<< "First frame time: " << d
.getFrameTime() << endl
;
57 error
= d
.nextFrame();
59 if(isError(error
)) cout
<< "Error: " << getErrorMessage(error
)<< endl
;
63 clock_t timef
= clock();
65 cout
<< "loop end...Time spent = " << ((timef
-time0
)/(double)CLOCKS_PER_SEC
) << endl
;