summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfred <fred@home.lan>2011-04-10 19:58:24 (GMT)
committer fred <fred@home.lan>2011-04-10 19:58:24 (GMT)
commite5664d8352555bf6c05954a04a67a3df1692bb94 (patch)
treeaba5994acc131f237a8b64b4471a3ac5365011bb
parent0d51bed1c5c9fe0186fb48def11a5bc7b752f09a (diff)
In VideoEncoder::thread_loop, removed fps calls to be like it was originally
- in VideoEncoder::thread_loop, FPS::calc and ::delay calls added for streaming to work at the good speed were removed. - In FPS::delay, waitTime removed as not used. wake_ts.tv_sec init also removed as it is already done by the ::calc() method.
-rw-r--r--qt/.gitignore2
-rw-r--r--src/fps.cpp3
-rw-r--r--src/include/video_encoder.h2
-rw-r--r--src/video_encoder.cpp2
4 files changed, 3 insertions, 6 deletions
diff --git a/qt/.gitignore b/qt/.gitignore
index 28c373b..79bd332 100644
--- a/qt/.gitignore
+++ b/qt/.gitignore
@@ -43,3 +43,5 @@ ui_qfreej.h
TODO.txt
Video/*
*.avi
+*.mp4
+*.ogv
diff --git a/src/fps.cpp b/src/fps.cpp
index 97d4535..ae4f3c6 100644
--- a/src/fps.cpp
+++ b/src/fps.cpp
@@ -135,11 +135,8 @@ double FPS::set(double rate) {
#if 1 // use nanosleep (otherwise select_sleep)
void FPS::delay() {
struct timespec remaining = { 0, 0 };
- long int waitTime = 0;
- wake_ts.tv_sec = 0;
if(wake_ts.tv_nsec >= 1000000) {
wake_ts.tv_nsec = wake_ts.tv_nsec - 1000000; // set the delay
- waitTime = wake_ts.tv_nsec;
}
do {
if (nanosleep(&wake_ts, &remaining) == -1) {
diff --git a/src/include/video_encoder.h b/src/include/video_encoder.h
index 2e1e6ee..d2124a1 100644
--- a/src/include/video_encoder.h
+++ b/src/include/video_encoder.h
@@ -126,7 +126,7 @@ class VideoEncoder: public Entry, public JSyncThread {
// char encbuf[1024*128];
// char encbuf[1024*2096];
char *encbuf;
- struct timeval m_ActualTime, m_OldTime/*, fpsCheck, fpsCheckLast*/;
+ struct timeval m_ActualTime, m_OldTime, m_lastTime;
double m_StreamRate;
int m_Streamed;
double m_ElapsedTime;
diff --git a/src/video_encoder.cpp b/src/video_encoder.cpp
index 2cc2a1d..2690b7f 100644
--- a/src/video_encoder.cpp
+++ b/src/video_encoder.cpp
@@ -206,8 +206,6 @@ void VideoEncoder::thread_loop() {
" tv_usec :" << fps->start_tv.tv_usec << " \r" << std::endl;
return;
}
- fps->calc(); //without this the thread_loop is called nearly two times more and
- fps->delay(); //stream speed is too slow
//uncomment this to see how long it takes between two frames in us.
/* timeval start_t;
gettimeofday(&start_t,NULL);