Skip to content

Commit

Permalink
cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Jul 4, 2024
1 parent e1d0e7b commit df75e8e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 31 deletions.
5 changes: 2 additions & 3 deletions worker/test/src/RTC/Codecs/TestH264.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ SCENARIO("parse H264 payload descriptor", "[codecs][h264]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::H264::Parse(buffer, sizeof(buffer));
std::unique_ptr<Codecs::H264::PayloadDescriptor> payloadDescriptor{ Codecs::H264::Parse(
buffer, sizeof(buffer)) };

REQUIRE(payloadDescriptor);

delete payloadDescriptor;
}
}
36 changes: 18 additions & 18 deletions worker/test/src/RTC/Codecs/TestH264_SVC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::H264_SVC::Parse(buffer, sizeof(buffer));
std::unique_ptr<RTC::Codecs::H264_SVC::PayloadDescriptor> payloadDescriptor{
Codecs::H264_SVC::Parse(buffer, sizeof(buffer))
};

REQUIRE(payloadDescriptor);

Expand All @@ -31,8 +33,6 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")
REQUIRE(payloadDescriptor->isKeyFrame == true);
REQUIRE(payloadDescriptor->hasTlIndex == false);
REQUIRE(payloadDescriptor->hasSlIndex == false);

delete payloadDescriptor;
}

SECTION("parse payload descriptor for NALU 8")
Expand All @@ -49,7 +49,9 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::H264_SVC::Parse(buffer, sizeof(buffer));
std::unique_ptr<RTC::Codecs::H264_SVC::PayloadDescriptor> payloadDescriptor{
Codecs::H264_SVC::Parse(buffer, sizeof(buffer))
};

REQUIRE(payloadDescriptor);

Expand All @@ -59,8 +61,6 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")
REQUIRE(payloadDescriptor->isKeyFrame == false);
REQUIRE(payloadDescriptor->hasTlIndex == false);
REQUIRE(payloadDescriptor->hasSlIndex == false);

delete payloadDescriptor;
}

SECTION("parse payload descriptor for NALU 1")
Expand All @@ -77,7 +77,9 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::H264_SVC::Parse(buffer, sizeof(buffer));
std::unique_ptr<RTC::Codecs::H264_SVC::PayloadDescriptor> payloadDescriptor{
Codecs::H264_SVC::Parse(buffer, sizeof(buffer))
};

REQUIRE(payloadDescriptor);

Expand All @@ -87,8 +89,6 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")
REQUIRE(payloadDescriptor->isKeyFrame == false);
REQUIRE(payloadDescriptor->hasTlIndex == false);
REQUIRE(payloadDescriptor->hasSlIndex == false);

delete payloadDescriptor;
}

SECTION("parse payload descriptor for NALU 5")
Expand All @@ -105,7 +105,9 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::H264_SVC::Parse(buffer, sizeof(buffer));
std::unique_ptr<RTC::Codecs::H264_SVC::PayloadDescriptor> payloadDescriptor{
Codecs::H264_SVC::Parse(buffer, sizeof(buffer))
};

REQUIRE(payloadDescriptor);

Expand All @@ -115,8 +117,6 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")
REQUIRE(payloadDescriptor->isKeyFrame == true);
REQUIRE(payloadDescriptor->hasTlIndex == false);
REQUIRE(payloadDescriptor->hasSlIndex == false);

delete payloadDescriptor;
}

SECTION("parse payload descriptor for NALU 14")
Expand All @@ -133,7 +133,9 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::H264_SVC::Parse(buffer, sizeof(buffer));
std::unique_ptr<RTC::Codecs::H264_SVC::PayloadDescriptor> payloadDescriptor{
Codecs::H264_SVC::Parse(buffer, sizeof(buffer))
};

REQUIRE(payloadDescriptor);

Expand All @@ -145,8 +147,6 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")
REQUIRE(payloadDescriptor->isKeyFrame == false);
REQUIRE(payloadDescriptor->hasTlIndex == true);
REQUIRE(payloadDescriptor->hasSlIndex == true);

delete payloadDescriptor;
}

SECTION("parse payload descriptor for NALU 20")
Expand All @@ -163,7 +163,9 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::H264_SVC::Parse(buffer, sizeof(buffer));
std::unique_ptr<RTC::Codecs::H264_SVC::PayloadDescriptor> payloadDescriptor{
Codecs::H264_SVC::Parse(buffer, sizeof(buffer))
};

REQUIRE(payloadDescriptor);

Expand All @@ -175,7 +177,5 @@ SCENARIO("parse H264_SVC payload descriptor", "[codecs][h264_svc]")
REQUIRE(payloadDescriptor->isKeyFrame == false);
REQUIRE(payloadDescriptor->hasTlIndex == true);
REQUIRE(payloadDescriptor->hasSlIndex == true);

delete payloadDescriptor;
}
}
10 changes: 4 additions & 6 deletions worker/test/src/RTC/Codecs/TestVP8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ SCENARIO("parse VP8 payload descriptor", "[codecs][vp8]")

std::memcpy(buffer, originalBuffer, sizeof(buffer));

const auto* payloadDescriptor = Codecs::VP8::Parse(buffer, sizeof(buffer));
std::unique_ptr<Codecs::VP8::PayloadDescriptor> payloadDescriptor{ Codecs::VP8::Parse(
buffer, sizeof(buffer)) };

REQUIRE(payloadDescriptor);

Expand Down Expand Up @@ -77,8 +78,6 @@ SCENARIO("parse VP8 payload descriptor", "[codecs][vp8]")
REQUIRE(std::memcmp(buffer, originalBuffer, sizeof(buffer)) == 0);
}
}

delete payloadDescriptor;
}

SECTION("parse payload descriptor 2")
Expand Down Expand Up @@ -113,7 +112,8 @@ SCENARIO("parse VP8 payload descriptor", "[codecs][vp8]")
std::memcpy(buffer, originalBuffer, sizeof(buffer));

// Parse the buffer.
const auto* payloadDescriptor = Codecs::VP8::Parse(buffer, sizeof(buffer));
std::unique_ptr<Codecs::VP8::PayloadDescriptor> payloadDescriptor{ Codecs::VP8::Parse(
buffer, sizeof(buffer)) };

REQUIRE(payloadDescriptor);

Expand Down Expand Up @@ -152,8 +152,6 @@ SCENARIO("parse VP8 payload descriptor", "[codecs][vp8]")
REQUIRE(std::memcmp(buffer, originalBuffer, sizeof(buffer)) == 0);
}
}

delete payloadDescriptor;
};

SECTION("parse payload descriptor. I flag set but no space for pictureId")
Expand Down
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsFir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ SCENARIO("RTCP Feedback PS FIR parsing", "[parser][rtcp][feedback-ps][fir]")

SECTION("parse FeedbackPsFirPacket")
{
FeedbackPsFirPacket* packet = FeedbackPsFirPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsFirPacket> packet{ FeedbackPsFirPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -61,8 +61,6 @@ SCENARIO("RTCP Feedback PS FIR parsing", "[parser][rtcp][feedback-ps][fir]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create FeedbackPsFirPacket")
Expand Down

0 comments on commit df75e8e

Please sign in to comment.