-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V4 support openharmony #20793
Open
1-newbie
wants to merge
5
commits into
cocos2d:v4-oh
Choose a base branch
from
1-newbie:v4-oh
base: v4-oh
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
V4 support openharmony #20793
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2016 Chukong Technologies Inc. | ||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. | ||
|
||
http://www.cocos2d-x.org | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
|
||
#define LOG_TAG "AssetFd" | ||
|
||
#include "cutils/log.h" | ||
#include "AssetFd.h" | ||
|
||
namespace cocos2d { | ||
|
||
AssetFd::AssetFd(int assetFd) | ||
: _assetFd(assetFd) { | ||
} | ||
|
||
AssetFd::~AssetFd() { | ||
ALOGV("~AssetFd: %d", _assetFd); | ||
if (_assetFd > 0) { | ||
::close(_assetFd); | ||
_assetFd = 0; | ||
} | ||
}; | ||
|
||
} // namespace cocos2d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2016 Chukong Technologies Inc. | ||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. | ||
|
||
http://www.cocos2d-x.org | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
#pragma once | ||
|
||
#include <unistd.h> | ||
|
||
namespace cocos2d { | ||
|
||
class AssetFd { | ||
public: | ||
AssetFd(int assetFd); | ||
~AssetFd(); | ||
|
||
inline int getFd() const { return _assetFd; }; | ||
|
||
private: | ||
int _assetFd; | ||
}; | ||
|
||
} // namespace CocosDenshion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#pragma once | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include "utils/Errors.h" | ||
|
||
namespace cocos2d { | ||
// ---------------------------------------------------------------------------- | ||
|
||
class AudioBufferProvider { | ||
public: | ||
// IDEA: merge with AudioTrackShared::Buffer, AudioTrack::Buffer, and AudioRecord::Buffer | ||
// and rename getNextBuffer() to obtainBuffer() | ||
struct Buffer { | ||
Buffer() : raw(NULL), frameCount(0) {} | ||
union { | ||
void *raw; | ||
short *i16; | ||
int8_t *i8; | ||
}; | ||
size_t frameCount; | ||
}; | ||
|
||
virtual ~AudioBufferProvider() {} | ||
|
||
// value representing an invalid presentation timestamp | ||
static const int64_t kInvalidPTS = 0x7FFFFFFFFFFFFFFFLL; // <stdint.h> is too painful | ||
|
||
// pts is the local time when the next sample yielded by getNextBuffer | ||
// will be rendered. | ||
// Pass kInvalidPTS if the PTS is unknown or not applicable. | ||
// On entry: | ||
// buffer != NULL | ||
// buffer->raw unused | ||
// buffer->frameCount maximum number of desired frames | ||
// On successful return: | ||
// status NO_ERROR | ||
// buffer->raw non-NULL pointer to buffer->frameCount contiguous available frames | ||
// buffer->frameCount number of contiguous available frames at buffer->raw, | ||
// 0 < buffer->frameCount <= entry value | ||
// On error return: | ||
// status != NO_ERROR | ||
// buffer->raw NULL | ||
// buffer->frameCount 0 | ||
virtual status_t getNextBuffer(Buffer *buffer, int64_t pts = kInvalidPTS) = 0; | ||
|
||
// Release (a portion of) the buffer previously obtained by getNextBuffer(). | ||
// It is permissible to call releaseBuffer() multiple times per getNextBuffer(). | ||
// On entry: | ||
// buffer->frameCount number of frames to release, must be <= number of frames | ||
// obtained but not yet released | ||
// buffer->raw unused | ||
// On return: | ||
// buffer->frameCount 0; implementation MUST set to zero | ||
// buffer->raw undefined; implementation is PERMITTED to set to any value, | ||
// so if caller needs to continue using this buffer it must | ||
// keep track of the pointer itself | ||
virtual void releaseBuffer(Buffer *buffer) = 0; | ||
}; | ||
|
||
// ---------------------------------------------------------------------------- | ||
} // namespace CocosDenshion |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
OHOS
mean harmonyOS or openharmony? It's really confused to me.Look at this in Cocos Creator: https://github.com/cocos/cocos-engine/blob/v3.8.2/native/CMakeLists.txt#L114
In Cocos Creator, OHOS macro is for HarmonyOS while OPENHARMONY macro is for openharmony OS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OHOS mean OpenHarmony OS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HarmonyOS should be HMOS