Skip to content

Commit

Permalink
Partial changes for the User Input loopback total Duration in pbtxt file
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchay97-dev committed Nov 28, 2024
1 parent 7928f44 commit 440aa78
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 53 deletions.
10 changes: 6 additions & 4 deletions app/src/main/java/com/facebook/encapp/BufferTranscoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ void bufferTranscoding(int trackIndex) throws IOException {
mLastTime = SystemClock.elapsedRealtimeNanos() / 1000;
long lastPresentationTimeUs = 0;
long accumulatedDurationUs = 0; // Tracks the total duration generated by loopbacks
long totalDurationUs = 60000000;; // Target duration in microseconds (e.g., 60 seconds)
long totalDurationUs = 1800000000;; // Target duration in microseconds (e.g., 1800 seconds)
boolean isEOS = false;
long timeoutUs = 10000; // Timeout for buffer operations
long loopback_counter = 0;
Expand All @@ -705,6 +705,8 @@ void bufferTranscoding(int trackIndex) throws IOException {
}

long starttime = Calendar.getInstance().getTimeInMillis();
// long temp = mTest.getInput().getLoopbackTotalDuration();
// Log.d(TAG, "totalDurationUs : " + temp);
while (accumulatedDurationUs < totalDurationUs) {
if (mInFramesCount % 100 == 0 && MainActivity.isStable()) {
Log.d(TAG, mTest.getCommon().getId() + " - " +
Expand Down Expand Up @@ -1336,8 +1338,8 @@ void submitFrameForEncoding(MediaMuxer muxer, int videoTrackIndex, FileOutputStr
}

if(muxer != null) {
muxer.writeSampleData(videoTrackIndex, buffer, info);
fileOutputStream.write(buffer.array(), 0, encodedBufferSize);
// muxer.writeSampleData(videoTrackIndex, buffer, info);
// fileOutputStream.write(buffer.array(), 0, encodedBufferSize);
}
framesWritten++;
}
Expand Down Expand Up @@ -1425,7 +1427,7 @@ void getEncodedFrame() {
if (mMuxer != null && mVideoTrack != -1) {
++mOutFramesCount;
ByteBuffer data = mCodec.getOutputBuffer(index);
mMuxer.writeSampleData(mVideoTrack, data, info);
// mMuxer.writeSampleData(mVideoTrack, data, info);
//Log.d(TAG, "Muxer writing to file Frame No:: " + mOutFramesCount + " encoded o/p size: " +data.limit());
Log.d(TAG, "Muxer writing to file Frame No:: " + framesWritten);
framesWritten++;
Expand Down
1 change: 1 addition & 0 deletions proto/tests.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ message Input {
optional bool realtime = 7;
optional float stoptime_sec = 8;
optional bool show = 9;
optional int64 loopback_totalDuration = 10;
}

message Configure {
Expand Down
92 changes: 43 additions & 49 deletions scripts/proto_tool/tests_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 440aa78

Please sign in to comment.