~jaromil/freej/master

« back to all changes in this revision

Viewing changes to src/video_encoder.cpp

  • Committer: fred
  • Date: 2011-01-25 17:32:31 UTC
  • Revision ID: git-v1:6126f899abcd96f6bab887cb2f840caf272b2c6b
Little modif in qt to test sound and streaming + various modif in freej

in qfreej : adding automatic call to ::openSoundDevice() when opening a
video.
Layer replaced by VideoLayer.
Added streaming config in ::Sound()
Changed from 10 to 1ms.

TODO file created (instead of the comments in the main)

in freej :
JackClient::Process() -> now writing jack outputs in a ring buffer.
commented out the RunCallback call.
OggTheoraEncoder:: -> a 30 sec recording to a file
from the JackClient ring buffer in wav PCM format added.

In theorautils.cpp -> work in progress :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * "$Id$"
20
20
 *
21
21
 */
22
 
 
 
22
#include <iostream>
23
23
 
24
24
#include <config.h>
25
25
 
166
166
void VideoEncoder::thread_setup() {
167
167
  func("ok, encoder %s in rolling loop",name);
168
168
  func("VideoEncoder::run : begin thread %p",pthread_self());
169
 
}
 
169
std::cout << "-------ok, video_encoder :" << status << ": in rolling loop"\
 
170
        << std::endl << std::flush;
 
171
 }
170
172
 
171
173
void VideoEncoder::thread_loop() {
172
174
  int encnum;
192
194
    if (!surface) {
193
195
        fps->calc();
194
196
        fps->delay();
 
197
                //std::cout << "fps->start_tv.tv_sec :" << fps->start_tv.tv_sec << \
 
198
                        " tv_usec :" << fps->start_tv.tv_usec << "   \r" << std::endl;
195
199
        return;
196
200
    }
 
201
    //gettimeofday(&actual_time,NULL);
 
202
    //fps->calc();      //without this the thread_loop is called nearly two times more and
 
203
    //fps->delay();     //stream speed is too slow
 
204
        //std::cout << "actual_time.tv_sec :" << actual_time.tv_sec << \
 
205
                        " tv_usec :" << actual_time.tv_usec << "   \r" << std::endl;
197
206
    screen->lock();
198
207
 
199
208
    switch(screen->get_pixel_format()) {