Fix coverity issue (INTEGER_OVERFLOW)
[platform/core/multimedia/libmm-fileinfo.git] / utils / mm_file_util_print.c
1 /*
2  * libmm-fileinfo
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Haejeong Kim <backto.kim@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #include "mm_file_debug.h"
23 #include "mm_file_utils.h"
24
25
26 void mmfile_format_print_contents(MMFileFormatContext *in)
27 {
28         if (in) {
29                 debug_msg(DEBUG, "formatType = %d\n", in->formatType);
30                 debug_msg(DEBUG, "commandType = %d\n", in->commandType);
31                 debug_msg(DEBUG, "duration = %d\n", in->duration);
32                 debug_msg(DEBUG, "videoTotalTrackNum = %d\n", in->videoTotalTrackNum);
33                 debug_msg(DEBUG, "audioTotalTrackNum = %d\n", in->audioTotalTrackNum);
34                 debug_msg(DEBUG, "nbStreams = %d\n", in->nbStreams);
35                 debug_msg(DEBUG, "audioStreamId = %d\n", in->audioStreamId);
36                 debug_msg(DEBUG, "videoStreamId = %d\n", in->videoStreamId);
37
38                 if (in->videoTotalTrackNum > 0 && in->streams[MMFILE_VIDEO_STREAM]) {
39                         debug_msg(DEBUG, "VstreamType = %d\n", in->streams[MMFILE_VIDEO_STREAM]->streamType);
40                         debug_msg(DEBUG, "VcodecId = %d\n", in->streams[MMFILE_VIDEO_STREAM]->codecId);
41                         debug_msg(DEBUG, "VbitRate = %d\n", in->streams[MMFILE_VIDEO_STREAM]->bitRate);
42                         debug_msg(DEBUG, "VframePerSec = %d\n", in->streams[MMFILE_VIDEO_STREAM]->framePerSec);
43                         debug_msg(DEBUG, "Vwidth = %d\n", in->streams[MMFILE_VIDEO_STREAM]->width);
44                         debug_msg(DEBUG, "Vheight = %d\n", in->streams[MMFILE_VIDEO_STREAM]->height);
45                         debug_msg(DEBUG, "VnbChannel = %d\n", in->streams[MMFILE_VIDEO_STREAM]->nbChannel);
46                         debug_msg(DEBUG, "VsamplePerSec = %d\n", in->streams[MMFILE_VIDEO_STREAM]->samplePerSec);
47                 }
48
49                 if (in->audioTotalTrackNum > 0 && in->streams[MMFILE_AUDIO_STREAM]) {
50                         debug_msg(DEBUG, "AstreamType = %d\n", in->streams[MMFILE_AUDIO_STREAM]->streamType);
51                         debug_msg(DEBUG, "AcodecId = %d\n", in->streams[MMFILE_AUDIO_STREAM]->codecId);
52                         debug_msg(DEBUG, "AbitRate = %d\n", in->streams[MMFILE_AUDIO_STREAM]->bitRate);
53                         debug_msg(DEBUG, "AframePerSec = %d\n", in->streams[MMFILE_AUDIO_STREAM]->framePerSec);
54                         debug_msg(DEBUG, "Awidth = %d\n", in->streams[MMFILE_AUDIO_STREAM]->width);
55                         debug_msg(DEBUG, "Aheight = %d\n", in->streams[MMFILE_AUDIO_STREAM]->height);
56                         debug_msg(DEBUG, "AnbChannel = %d\n", in->streams[MMFILE_AUDIO_STREAM]->nbChannel);
57                         debug_msg(DEBUG, "AsamplePerSec = %d\n", in->streams[MMFILE_AUDIO_STREAM]->samplePerSec);
58                 }
59         }
60 }
61
62
63 void mmfile_format_print_tags(MMFileFormatContext *in)
64 {
65         if (in) {
66                 if (in->title)                          debug_msg(DEBUG, "title = %s\n", in->title);
67                 if (in->artist)                         debug_msg(DEBUG, "artist = %s\n", in->artist);
68                 if (in->author)                 debug_msg(DEBUG, "author = %s\n", in->author);
69                 if (in->composer)                       debug_msg(DEBUG, "composer = %s\n", in->composer);
70                 if (in->album)                  debug_msg(DEBUG, "album = %s\n", in->album);
71                 if (in->album_artist)                   debug_msg(DEBUG, "album_artist = %s\n", in->album_artist);
72                 if (in->copyright)                      debug_msg(DEBUG, "copyright = %s\n", in->copyright);
73                 if (in->comment)                        debug_msg(DEBUG, "comment = %s\n", in->comment);
74                 if (in->genre)                  debug_msg(DEBUG, "genre = %s\n", in->genre);
75                 if (in->year)                           debug_msg(DEBUG, "year = %s\n", in->year);
76                 if (in->recDate)                        debug_msg(DEBUG, "recDate = %s\n", in->recDate);
77                 if (in->tagTrackNum)            debug_msg(DEBUG, "tagTrackNum = %s\n", in->tagTrackNum);
78                 if (in->artworkMime)            debug_msg(DEBUG, "artworkMime = %s\n", in->artworkMime);
79                 debug_msg(DEBUG, "artworksize = %d\n", in->artworkSize);
80                 if (in->artwork)                        debug_msg(DEBUG, "artwork = %p\n", in->artwork);
81                 if (in->classification)         debug_msg(DEBUG, "classification = %s\n", in->classification);
82         }
83 }
84
85
86 void mmfile_format_print_frame(MMFileFormatFrame *in)
87 {
88         if (in) {
89                 debug_msg(DEBUG, "in->frameData = %p\n", in->frameData);
90                 debug_msg(DEBUG, "in->frameHeight = %d\n", in->frameHeight);
91                 debug_msg(DEBUG, "in->frameWidth = %d\n", in->frameWidth);
92                 debug_msg(DEBUG, "in->frameSize = %d\n", in->frameSize);
93                 debug_msg(DEBUG, "in->configLenth = %d\n", in->configLenth);
94                 debug_msg(DEBUG, "in->configData = %p\n", in->configData);
95         }
96 }