Skip to content
Snippets Groups Projects

DeviceLister refactoring for new API

Merged Geoffrey Métais requested to merge Dekans/vlc-android:mediagroups into master
3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 1 #include "AndroidDeviceLister.h"
2 #define LOG_TAG "VLC/JNI/AndroidDeviceLister"
3 #include "log.h"
2 4
3 5 std::vector<std::tuple<std::string, std::string, bool>>
4 6 AndroidDeviceLister::devices() const
  • 7 9 std::vector<std::tuple<std::string, std::string, bool>> devices;
    8 10 devices.reserve( m_devices.size() );
    9 for(auto kv : m_devices)
    10 devices.push_back(kv.second);
    11 for(auto kv : m_devices) devices.push_back(kv.second);
    11 12 return devices;
    12 13 }
    13 14
    14 void
    15 bool
    15 16 AndroidDeviceLister::addDevice(std::string uuid, std::string path, bool removable)
    16 17 {
    18 LOGD("addDevice %s %s", uuid.c_str(), path.c_str());
    17 19 std::lock_guard<std::mutex> guard(m_mutex);
    18 20 m_devices.insert(std::make_pair(uuid, std::make_tuple(uuid, path, removable)));
    21 return p_DeviceListerCb->onDeviceMounted(uuid, path, removable);
  • 16 17 {
    18 LOGD("addDevice %s %s", uuid.c_str(), path.c_str());
    17 19 std::lock_guard<std::mutex> guard(m_mutex);
    18 20 m_devices.insert(std::make_pair(uuid, std::make_tuple(uuid, path, removable)));
    21 return p_DeviceListerCb->onDeviceMounted(uuid, path, removable);
    19 22 }
    20 23
    21 24 bool
    22 AndroidDeviceLister::removeDevice(std::string uuidToRemove)
    25 AndroidDeviceLister::removeDevice(std::string uuidToRemove, const std::string& path)
    23 26 {
    24 27 std::lock_guard<std::mutex> guard(m_mutex);
    25 return m_devices.erase(uuidToRemove);
    28 auto erased = m_devices.erase(uuidToRemove);
    29 p_DeviceListerCb->onDeviceUnmounted(uuidToRemove, path);
    30 return erased;
  • added 1 commit

    • 32a762af - Lister fix and start removal

    Compare with previous version

  • Geoffrey Métais added 14 commits

    added 14 commits

    Compare with previous version

  • added 17 commits

    Compare with previous version

  • added 1 commit

    • ff41347b - DeviceLister refactoring for new API

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Geoffrey Métais unmarked as a Work In Progress

    unmarked as a Work In Progress

  • added 1 commit

    • e7d4e9ee - Medialibrary: Implement new media groups functions

    Compare with previous version

  • Geoffrey Métais enabled an automatic merge when the pipeline for e7d4e9ee succeeds

    enabled an automatic merge when the pipeline for e7d4e9ee succeeds

  • Please register or sign in to reply
    Loading