Ocean
Loading...
Searching...
No Matches
TestAndroid.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TESTMEDIA_TEST_ANDROID_H
9#define META_OCEAN_TEST_TESTMEDIA_TEST_ANDROID_H
10
12
14
15#ifdef OCEAN_PLATFORM_BUILD_ANDROID
16
17#include "ocean/base/Frame.h"
18
19namespace Ocean
20{
21
22namespace Test
23{
24
25namespace TestMedia
26{
27
28/**
29 * This class implements tests for Android media functionality.
30 * @ingroup testmedia
31 */
32class OCEAN_TEST_MEDIA_EXPORT TestAndroid
33{
34 public:
35
36 /**
37 * Invokes all tests.
38 * @param testDuration Number of seconds for each test, with range (0, infinity)
39 * @param selector The test selector
40 * @return True, if succeeded
41 */
42 static bool test(const double testDuration, const TestSelector& selector);
43
44 /**
45 * Tests the video encoder and decoder.
46 * This test encodes frames using VideoEncoder and then decodes them using VideoDecoder.
47 * @param testDuration Number of seconds for each test, with range (0, infinity)
48 * @return True, if succeeded
49 */
50 static bool testVideoEncoderDecoder(const double testDuration);
51
52 protected:
53
54 /**
55 * Creates a test frame with a specific pattern.
56 * @param width The width of the frame, with range [1, infinity)
57 * @param height The height of the frame, with range [1, infinity)
58 * @param frameIndex The index of the frame, used to create a unique pattern
59 * @return The created frame
60 */
61 static Frame createTestFrame(const unsigned int width, const unsigned int height, const unsigned int frameIndex);
62
63 /**
64 * Validates that a decoded frame matches the expected test frame.
65 * @param testFrame The test frame to validate, must be valid
66 * @param decodedFrame The decoded frame to validate, must be valid
67 * @return True, if the decoded frame matches the expected test (within tolerance)
68 */
69 static bool validateTestFrame(const Frame& testFrame, const Frame& decodedFrame);
70};
71
72}
73
74}
75
76}
77
78#endif // OCEAN_PLATFORM_BUILD_ANDROID
79
80#endif // META_OCEAN_TEST_TESTMEDIA_TEST_ANDROID_H
This class implements Ocean's image class.
Definition Frame.h:1879
This class implements tests for Android media functionality.
Definition TestAndroid.h:33
static bool validateTestFrame(const Frame &testFrame, const Frame &decodedFrame)
Validates that a decoded frame matches the expected test frame.
static bool testVideoEncoderDecoder(const double testDuration)
Tests the video encoder and decoder.
static bool test(const double testDuration, const TestSelector &selector)
Invokes all tests.
static Frame createTestFrame(const unsigned int width, const unsigned int height, const unsigned int frameIndex)
Creates a test frame with a specific pattern.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15