Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add pipe monitoring (debug() functions)

  • Loading branch information...
commit 8c224993777d705d1865406e523722fece0a1f12 1 parent b4d38b1
@asquared asquared authored
View
8 replay/replay_app.rb
@@ -38,6 +38,10 @@ def initialize(opts={})
end
end
+ def debug
+ @ingest.debug
+ end
+
def suspend_encode
@ingest.suspend_encode
end
@@ -188,6 +192,10 @@ def resume_encode
@sources.each { |source| source.resume_encode }
end
+ def debug
+ @sources.each { |source| source.debug }
+ end
+
def start_irb
IRB.start_session(binding())
end
View
5 replay/replay_ingest.cpp
@@ -34,6 +34,11 @@ ReplayIngest::~ReplayIngest( ) {
}
+void ReplayIngest::debug( ) {
+ fprintf(stderr, "ingest for %s\n", buf->get_name( ));
+ iadp->output_pipe( ).debug( );
+}
+
void ReplayIngest::run_thread( ) {
RawFrame *input, *thumb;
ReplayRawFrame *monitor_frame;
View
2  replay/replay_ingest.h
@@ -40,6 +40,8 @@ class ReplayIngest : public Thread {
void suspend_encode( );
void resume_encode( );
+ void debug( );
+
protected:
void run_thread( );
View
1  replay/replay_ingest.i
@@ -32,5 +32,6 @@ class ReplayIngest : public Thread {
void suspend_encode( );
void resume_encode( );
+ void debug( );
};
View
10 thread/pipe.h
@@ -167,6 +167,16 @@ class Pipe {
}
}
+ void debug(void) {
+ MutexLock lock(mut);
+ if (read_ptr <= write_ptr) {
+ fprintf(stderr, "pipe: %u used\n", (write_ptr - read_ptr));
+ } else {
+ fprintf(stderr, "pipe: %u used\n",
+ (buf_len - read_ptr) + (write_ptr - 1));
+ }
+ }
+
~Pipe( ) {
for (unsigned int i = 0; i < buf_len; i++) {
if (buf[i] != NULL) {
Please sign in to comment.
Something went wrong with that request. Please try again.