Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
757dcc85
Commit
757dcc85
authored
17 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
Clean up and documentation
parent
97e0438e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/audio/codecDescriptor.cpp
+4
-13
4 additions, 13 deletions
src/audio/codecDescriptor.cpp
src/audio/codecDescriptor.h
+27
-5
27 additions, 5 deletions
src/audio/codecDescriptor.h
with
31 additions
and
18 deletions
src/audio/codecDescriptor.cpp
+
4
−
13
View file @
757dcc85
...
@@ -39,7 +39,6 @@ CodecDescriptor::~CodecDescriptor()
...
@@ -39,7 +39,6 @@ CodecDescriptor::~CodecDescriptor()
void
void
CodecDescriptor
::
deleteHandlePointer
(
void
)
CodecDescriptor
::
deleteHandlePointer
(
void
)
{
{
//_debug("Destroy codecs handles\n");
int
i
;
int
i
;
for
(
i
=
0
;
i
<
_CodecInMemory
.
size
()
;
i
++
)
for
(
i
=
0
;
i
<
_CodecInMemory
.
size
()
;
i
++
)
{
{
...
@@ -51,11 +50,13 @@ CodecDescriptor::deleteHandlePointer( void )
...
@@ -51,11 +50,13 @@ CodecDescriptor::deleteHandlePointer( void )
void
void
CodecDescriptor
::
init
()
CodecDescriptor
::
init
()
{
{
std
::
stringstream
errMsg
;
std
::
vector
<
AudioCodec
*>
CodecDynamicList
=
scanCodecDirectory
();
std
::
vector
<
AudioCodec
*>
CodecDynamicList
=
scanCodecDirectory
();
_nbCodecs
=
CodecDynamicList
.
size
();
_nbCodecs
=
CodecDynamicList
.
size
();
if
(
_nbCodecs
<=
0
){
if
(
_nbCodecs
<=
0
){
_debug
(
"Error - No codecs available in directory %s
\n
"
,
CODECS_DIR
);
errMsg
<<
"Error - No codecs available in directory "
<<
CODECS_DIR
;
exit
(
0
);
_debug
(
"%s
\n
"
,
errMsg
.
str
().
c_str
());
//exit(0);
}
}
int
i
;
int
i
;
...
@@ -114,16 +115,6 @@ CodecDescriptor::isActive(AudioCodecType payload)
...
@@ -114,16 +115,6 @@ CodecDescriptor::isActive(AudioCodecType payload)
void
void
CodecDescriptor
::
removeCodec
(
AudioCodecType
payload
)
CodecDescriptor
::
removeCodec
(
AudioCodecType
payload
)
{
{
CodecMap
::
iterator
iter
=
_codecMap
.
begin
();
while
(
iter
!=
_codecMap
.
end
())
{
if
(
iter
->
first
==
payload
)
{
_debug
(
"Codec %s removed from the list"
,
getCodecName
(
payload
).
data
());
_codecMap
.
erase
(
iter
);
break
;
}
iter
++
;
}
}
}
void
void
...
...
This diff is collapsed.
Click to expand it.
src/audio/codecDescriptor.h
+
27
−
5
View file @
757dcc85
...
@@ -76,7 +76,6 @@ public:
...
@@ -76,7 +76,6 @@ public:
/*
/*
* Accessor to data structures
* Accessor to data structures
*/
*/
CodecMap
&
getCodecMap
()
{
return
_codecMap
;
}
CodecsMap
&
getCodecsMap
()
{
return
_CodecsMap
;
}
CodecsMap
&
getCodecsMap
()
{
return
_CodecsMap
;
}
CodecOrder
&
getActiveCodecs
()
{
return
_codecOrder
;
}
CodecOrder
&
getActiveCodecs
()
{
return
_codecOrder
;
}
...
@@ -203,16 +202,33 @@ private:
...
@@ -203,16 +202,33 @@ private:
*/
*/
void
unloadCodec
(
CodecHandlePointer
);
void
unloadCodec
(
CodecHandlePointer
);
/*
* Check if the files found in searched directories seems valid
* @param std::string The name of the file
* @return true if the file name begins with libcodec_ and ends with .so
* false otherwise
*/
bool
seemsValid
(
std
::
string
);
bool
seemsValid
(
std
::
string
);
/*
* Check if the codecs shared library has already been scanned during the session
* Useful not to load twice the same codec saved in the different directory
* @param std::string The complete name of the shared directory ( without the path )
* @return true if the codecs has been scanned
* false otherwise
*/
bool
alreadyInCache
(
std
::
string
);
bool
alreadyInCache
(
std
::
string
);
bool
isCodecLoaded
(
int
payload
);
/*
/*
* Map the payload of a codec and its name
* Check if the audiocodec object has been successfully created
* @param payload The payload of the codec
* @return true if the audiocodec has been created
* false otherwise
*/
*/
CodecMap
_codecMap
;
bool
isCodecLoaded
(
int
payload
)
;
/*
/*
* Map the payload of a codec and the object associated
* Map the payload of a codec and the object associated
( AudioCodec * )
*/
*/
CodecsMap
_CodecsMap
;
CodecsMap
_CodecsMap
;
...
@@ -221,6 +237,9 @@ private:
...
@@ -221,6 +237,9 @@ private:
*/
*/
CodecOrder
_codecOrder
;
CodecOrder
_codecOrder
;
/*
* Vector containing the complete name of the codec shared library scanned
*/
std
::
vector
<
std
::
string
>
_Cache
;
std
::
vector
<
std
::
string
>
_Cache
;
/*
/*
...
@@ -233,6 +252,9 @@ private:
...
@@ -233,6 +252,9 @@ private:
* Pair between pointer on function handle and pointer on audiocodec object
* Pair between pointer on function handle and pointer on audiocodec object
*/
*/
std
::
vector
<
CodecHandlePointer
>
_CodecInMemory
;
std
::
vector
<
CodecHandlePointer
>
_CodecInMemory
;
};
};
#endif // __CODEC_DESCRIPTOR_H__
#endif // __CODEC_DESCRIPTOR_H__
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment