1 /*
2 * Copyright (C) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include "object_info.h"
16 #include "media_log.h"
17 #include "mtp_packet_tools.h"
18 using namespace std;
19 namespace OHOS {
20 namespace Media {
ObjectInfo(uint32_t h)21 ObjectInfo::ObjectInfo(uint32_t h) : handle(h)
22 {
23 }
24 
~ObjectInfo()25 ObjectInfo::~ObjectInfo()
26 {
27 }
28 
Dump()29 void ObjectInfo::Dump()
30 {
31     MEDIA_DEBUG_LOG("=== ObjectInfo {handle=%{private}x, name=[%{private}s]} begin ===", handle, name.c_str());
32 
33     MEDIA_DEBUG_LOG("    storageID=%{private}x, format=%{private}s(%{private}x), parent=%{private}x",
34         storageID, MtpPacketTool::GetFormatName(format).c_str(), format, parent);
35 
36     MEDIA_DEBUG_LOG("    association={type=%{private}s(%{private}x), desc=%{private}x}",
37         MtpPacketTool::GetAssociationName(associationType).c_str(), associationType, associationDesc);
38 
39     MEDIA_DEBUG_LOG("    protectionStatus=%{private}u, compressedSize=%{private}u, size=%{private}u",
40         protectionStatus, compressedSize, size);
41 
42     MEDIA_DEBUG_LOG("    image={pixWidth=%{private}u, pixHeight=%{private}u, pixDepth=%{private}u}",
43         imagePixelWidth, imagePixelHeight, imagePixelDepth);
44 
45     MEDIA_DEBUG_LOG("    thumb={format=%{private}s(%{private}x), compressedSize=%{private}u,"
46         " pixWidth=%{private}u, pixHeight=%{private}u}",
47         MtpPacketTool::GetFormatName(thumbFormat).c_str(), thumbFormat, thumbCompressedSize,
48         thumbPixelWidth, thumbPixelHeight);
49 
50     MEDIA_DEBUG_LOG("    keywords=[%{private}s]", keywords.c_str());
51     MEDIA_DEBUG_LOG("--- ObjectInfo end ---");
52 }
53 } // namespace Media
54 } // namespace OHOS